Expose spirv extensions

Change-Id: I64d05ed2bcc4c3ae005c39b9c22d0f67d7ca6a7e
This commit is contained in:
Adam Cetnerowski
2018-11-19 11:19:38 +01:00
committed by sys_ocldev
parent d6870a896b
commit bbc7afc952
4 changed files with 31 additions and 0 deletions

View File

@@ -144,6 +144,9 @@ void Device::initializeCaps() {
deviceInfo.independentForwardProgress = true;
deviceExtensions += "cl_khr_subgroups ";
deviceExtensions += "cl_khr_il_program ";
deviceExtensions += "cl_intel_spirv_side_avc_motion_estimation ";
deviceExtensions += "cl_intel_spirv_media_block_io ";
deviceExtensions += "cl_intel_spirv_subgroups ";
} else {
deviceInfo.independentForwardProgress = false;
}

View File

@@ -42,6 +42,9 @@ std::string getExtensionsList(const HardwareInfo &hwInfo) {
if (hwInfo.capabilityTable.clVersionSupport >= 21) {
allExtensionsList += "cl_khr_subgroups ";
allExtensionsList += "cl_khr_il_program ";
allExtensionsList += "cl_intel_spirv_side_avc_motion_estimation ";
allExtensionsList += "cl_intel_spirv_media_block_io ";
allExtensionsList += "cl_intel_spirv_subgroups ";
}
if (hwInfo.capabilityTable.ftrSupportsFP64) {

View File

@@ -399,6 +399,28 @@ TEST(Device_GetCaps, givenOpenCLVersion20WhenCapsAreCreatedThenDeviceDoesntRepor
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_khr_il_program"))));
}
TEST(Device_GetCaps, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReportsClIntelSpirvExtensions) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(21);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_side_avc_motion_estimation")));
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_subgroups")));
}
TEST(Device_GetCaps, givenOpenCLVersion12WhenCapsAreCreatedThenDeviceDoesntReportClIntelSpirvExtensions) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceOCLVersion.set(12);
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_side_avc_motion_estimation"))));
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))));
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_subgroups"))));
}
TEST(Device_GetCaps, givenEnableNV12setToTrueWhenCapsAreCreatedThenDeviceReportsNV12Extension) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.EnableNV12.set(true);

View File

@@ -158,6 +158,9 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching
if (hwInfo->capabilityTable.clVersionSupport > 20) {
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_subgroups")));
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_il_program")));
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_side_avc_motion_estimation")));
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_subgroups")));
}
if (hwInfo->capabilityTable.ftrSupportsFP64) {