Skip to content

Commit 6b8d8cb

Browse files
Revert "Revert "Expose spirv extensions""
This reverts commit 469fe40. Change-Id: I8b634ef05a3b7e4e6abb05b42eacae24b7871632
1 parent 8ec072d commit 6b8d8cb

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

runtime/device/device_caps.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ void Device::initializeCaps() {
144144
deviceInfo.independentForwardProgress = true;
145145
deviceExtensions += "cl_khr_subgroups ";
146146
deviceExtensions += "cl_khr_il_program ";
147+
deviceExtensions += "cl_intel_spirv_side_avc_motion_estimation ";
148+
deviceExtensions += "cl_intel_spirv_media_block_io ";
149+
deviceExtensions += "cl_intel_spirv_subgroups ";
147150
} else {
148151
deviceInfo.independentForwardProgress = false;
149152
}

runtime/platform/extensions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ std::string getExtensionsList(const HardwareInfo &hwInfo) {
4242
if (hwInfo.capabilityTable.clVersionSupport >= 21) {
4343
allExtensionsList += "cl_khr_subgroups ";
4444
allExtensionsList += "cl_khr_il_program ";
45+
allExtensionsList += "cl_intel_spirv_side_avc_motion_estimation ";
46+
allExtensionsList += "cl_intel_spirv_media_block_io ";
47+
allExtensionsList += "cl_intel_spirv_subgroups ";
4548
}
4649

4750
if (hwInfo.capabilityTable.ftrSupportsFP64) {

unit_tests/device/device_caps_tests.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,28 @@ TEST(Device_GetCaps, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntRepor
399399
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_khr_il_program"))));
400400
}
401401

402+
TEST(Device_GetCaps, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClIntelSpirvExtensions) {
403+
DebugManagerStateRestore dbgRestorer;
404+
DebugManager.flags.ForceOCLVersion.set(21);
405+
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
406+
const auto &caps = device->getDeviceInfo();
407+
408+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_side_avc_motion_estimation")));
409+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
410+
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_subgroups")));
411+
}
412+
413+
TEST(Device_GetCaps, givenOpenCLVersion12WhenCapsAreCreatedThenDeviceDoesntReportClIntelSpirvExtensions) {
414+
DebugManagerStateRestore dbgRestorer;
415+
DebugManager.flags.ForceOCLVersion.set(12);
416+
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
417+
const auto &caps = device->getDeviceInfo();
418+
419+
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_side_avc_motion_estimation"))));
420+
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))));
421+
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_subgroups"))));
422+
}
423+
402424
TEST(Device_GetCaps, givenEnableNV12setToTrueWhenCapsAreCreatedThenDeviceReportsNV12Extension) {
403425
DebugManagerStateRestore dbgRestorer;
404426
DebugManager.flags.EnableNV12.set(true);

unit_tests/platform/platform_tests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching
217217
if (hwInfo->capabilityTable.clVersionSupport > 20) {
218218
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
219219
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_il_program")));
220+
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_side_avc_motion_estimation")));
221+
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
222+
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_subgroups")));
220223
}
221224

222225
if (hwInfo->capabilityTable.ftrSupportsFP64) {

0 commit comments

Comments
 (0)