Add options when building the program

Report "-ocl-version=300" when OCL 3.0 is enabled.
Report "-cl-feature=" with list of supported features.

Related-To: NEO-4368

Change-Id: I9aee559ed53541a0f0c1a2a004926d9d29a53d94
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-06-16 20:54:15 +02:00
committed by sys_ocldev
parent f0aef442ec
commit 45f0bc56bc
15 changed files with 220 additions and 92 deletions

View File

@ -13,6 +13,7 @@
#include "shared/test/unit_test/mocks/mock_device.h"
#include "opencl/source/memory_manager/os_agnostic_memory_manager.h"
#include "opencl/source/platform/extensions.h"
#include "opencl/test/unit_test/helpers/hw_helper_tests.h"
#include "opencl/test/unit_test/mocks/mock_builtins.h"
#include "opencl/test/unit_test/mocks/mock_execution_environment.h"
@ -1029,6 +1030,19 @@ TEST(DeviceGetCaps, givenDeviceThatDoesHaveFp64WhenDbgFlagDisablesFp64ThenDontRe
EXPECT_NE(notExpectedSingleFp, actualSingleFp);
}
TEST(DeviceGetCaps, WhenPeekingCompilerFeaturesThenCompilerFeaturesAreReturned) {
UltClDeviceFactory deviceFactory{1, 0};
auto pClDevice = deviceFactory.rootDevices[0];
EXPECT_EQ(&pClDevice->compilerFeatures, &pClDevice->peekCompilerFeatures());
}
TEST(DeviceGetCaps, WhenCheckingCompilerFeaturesThenValueIsCorrect) {
UltClDeviceFactory deviceFactory{1, 0};
auto pClDevice = deviceFactory.rootDevices[0];
auto expectedCompilerFeatures = convertEnabledOclCFeaturesToCompilerInternalOptions(pClDevice->deviceInfo.openclCFeatures);
EXPECT_STREQ(expectedCompilerFeatures.c_str(), pClDevice->compilerFeatures.c_str());
}
TEST(DeviceGetCaps, givenOclVersionLessThan21WhenCapsAreCreatedThenDeviceReportsNoSupportedIlVersions) {
DebugManagerStateRestore dbgRestorer;
{