mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Enable overriding OpenCL version to 3.0
Related-To: NEO-4368 Change-Id: I6e2469861ca98649050b0f6251064ae6cce673be Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
caee16d968
commit
b817d3e95a
@ -102,6 +102,10 @@ void ClDevice::initializeCaps() {
|
||||
ocl21FeaturesEnabled = DebugManager.flags.ForceOCL21FeaturesSupport.get();
|
||||
}
|
||||
switch (enabledClVersion) {
|
||||
case 30:
|
||||
deviceInfo.clVersion = "OpenCL 3.0 NEO ";
|
||||
deviceInfo.clCVersion = "OpenCL C 3.0 ";
|
||||
break;
|
||||
case 21:
|
||||
deviceInfo.clVersion = "OpenCL 2.1 NEO ";
|
||||
deviceInfo.clCVersion = "OpenCL C 2.0 ";
|
||||
|
@ -254,6 +254,16 @@ TEST_F(DeviceGetCapsTest, givenDeviceWithMidThreadPreemptionWhenDeviceIsCreatedT
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(DeviceGetCapsTest, givenForceOclVersion30WhenCapsAreCreatedThenDeviceReportsOpenCL30) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceOCLVersion.set(30);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
const auto &caps = device->getDeviceInfo();
|
||||
EXPECT_STREQ("OpenCL 3.0 NEO ", caps.clVersion);
|
||||
EXPECT_STREQ("OpenCL C 3.0 ", caps.clCVersion);
|
||||
EXPECT_FALSE(device->ocl21FeaturesEnabled);
|
||||
}
|
||||
|
||||
TEST_F(DeviceGetCapsTest, givenForceOclVersion21WhenCapsAreCreatedThenDeviceReportsOpenCL21) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceOCLVersion.set(21);
|
||||
@ -290,6 +300,14 @@ TEST_F(DeviceGetCapsTest, givenForceOCL21FeaturesSupportDisabledWhenCapsAreCreat
|
||||
EXPECT_FALSE(device->ocl21FeaturesEnabled);
|
||||
}
|
||||
|
||||
TEST_F(DeviceGetCapsTest, givenForceOcl30AndForceOCL21FeaturesSupportEnabledWhenCapsAreCreatedThenDeviceReportsSupportOfOcl21Features) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ForceOCLVersion.set(30);
|
||||
DebugManager.flags.ForceOCL21FeaturesSupport.set(1);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
EXPECT_TRUE(device->ocl21FeaturesEnabled);
|
||||
}
|
||||
|
||||
TEST_F(DeviceGetCapsTest, givenForceInvalidOclVersionWhenCapsAreCreatedThenDeviceWillDefaultToOpenCL12) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
{
|
||||
|
Reference in New Issue
Block a user