Correct setting il version

Related-To: NEO-4368

Change-Id: I78111e0c28318f85657ab3cb545d4a5948f7b3d3
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-05-15 11:16:52 +02:00
committed by sys_ocldev
parent c4c7d72aa5
commit 4f5c80c916
2 changed files with 16 additions and 11 deletions

View File

@ -911,14 +911,21 @@ TEST(DeviceGetCaps, givenOclVersionLessThan21WhenCapsAreCreatedThenDeviceReports
}
}
TEST(DeviceGetCaps, givenOclVersion21WhenCapsAreCreatedThenDeviceReportsSpirvAsSupportedIl) {
TEST(DeviceGetCaps, givenOcl21FeaturesSupportedWhenCapsAreCreatedThenDeviceReportsSpirvAsSupportedIl) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCL21FeaturesSupport.set(1);
{
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("SPIR-V_1.2 ", caps.ilVersion);
}
DebugManager.flags.ForceOCL21FeaturesSupport.set(-1);
DebugManager.flags.ForceOCLVersion.set(21);
{
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
const auto &caps = device->getDeviceInfo();
EXPECT_STREQ("SPIR-V_1.2 ", caps.ilVersion);
DebugManager.flags.ForceOCLVersion.set(0);
}
}

View File

@ -24,18 +24,16 @@ void Device::initializeCaps() {
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
deviceInfo.ilVersion = "";
auto enabledClVersion = hwInfo.capabilityTable.clVersionSupport;
bool ocl21FeaturesEnabled = hwInfo.capabilityTable.supportsOcl21Features;
if (DebugManager.flags.ForceOCLVersion.get() != 0) {
enabledClVersion = DebugManager.flags.ForceOCLVersion.get();
ocl21FeaturesEnabled = (DebugManager.flags.ForceOCLVersion.get() == 21);
}
switch (enabledClVersion) {
case 21:
if (DebugManager.flags.ForceOCL21FeaturesSupport.get() != -1) {
ocl21FeaturesEnabled = DebugManager.flags.ForceOCL21FeaturesSupport.get();
}
if (ocl21FeaturesEnabled) {
deviceInfo.ilVersion = spirvVersion;
addressing32bitAllowed = false;
break;
case 20:
addressing32bitAllowed = false;
break;
}
deviceInfo.vendorId = 0x8086;