Correct media_block_io extension reporting

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-05-10 11:53:11 +00:00
committed by Compute-Runtime-Automation
parent 9ddf47b8b4
commit 3dbe37c423
2 changed files with 29 additions and 17 deletions

View File

@ -146,7 +146,7 @@ void ClDevice::initializeCaps() {
if (supportsVme) { if (supportsVme) {
deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation "; deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation ";
} }
if (hwInfo.capabilityTable.supportsImages) { if (hwHelper.isMediaBlockIOSupported(hwInfo)) {
deviceExtensions += "cl_intel_spirv_media_block_io "; deviceExtensions += "cl_intel_spirv_media_block_io ";
} }
deviceExtensions += "cl_intel_spirv_subgroups "; deviceExtensions += "cl_intel_spirv_subgroups ";

View File

@ -569,21 +569,27 @@ TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReport
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get())); auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
const auto &caps = device->getDeviceInfo(); const auto &caps = device->getDeviceInfo();
const HardwareInfo *hwInfo = defaultHwInfo.get(); const HardwareInfo *hwInfo = defaultHwInfo.get();
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
{
if (hwInfo->capabilityTable.supportsVme) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_device_side_avc_motion_estimation")));
} else {
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_device_side_avc_motion_estimation"))));
}
if (hwInfo->capabilityTable.supportsImages) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_3d_image_writes")));
} else {
EXPECT_THAT(caps.deviceExtensions, testing::Not(std::string("cl_khr_3d_image_writes")));
}
if (hwHelper.isMediaBlockIOSupported(*hwInfo)) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
} else {
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))));
}
if (hwInfo->capabilityTable.supportsVme) { EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_subgroups")));
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_device_side_avc_motion_estimation"))); EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_spirv_no_integer_wrap_decoration")));
} else {
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_device_side_avc_motion_estimation"))));
} }
if (hwInfo->capabilityTable.supportsImages) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_3d_image_writes")));
} else {
EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))));
EXPECT_THAT(caps.deviceExtensions, testing::Not(std::string("cl_khr_3d_image_writes")));
}
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_subgroups")));
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_khr_spirv_no_integer_wrap_decoration")));
} }
TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsClIntelSpirvMediaBlockIoExtensions) { TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsClIntelSpirvMediaBlockIoExtensions) {
@ -593,7 +599,11 @@ TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsC
hwInfo.capabilityTable.supportsImages = true; hwInfo.capabilityTable.supportsImages = true;
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo)); auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
const auto &caps = device->getDeviceInfo(); const auto &caps = device->getDeviceInfo();
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (hwHelper.isMediaBlockIOSupported(hwInfo)) {
EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")));
}
} }
TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotReportsClIntelSpirvMediaBlockIoExtensions) { TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotReportsClIntelSpirvMediaBlockIoExtensions) {
@ -985,9 +995,11 @@ TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCreateExtentionsListThenDeviceRe
EXPECT_THAT(extensions, testing::HasSubstr(std::string("cl_khr_image2d_from_buffer"))); EXPECT_THAT(extensions, testing::HasSubstr(std::string("cl_khr_image2d_from_buffer")));
EXPECT_THAT(extensions, testing::HasSubstr(std::string("cl_khr_depth_images"))); EXPECT_THAT(extensions, testing::HasSubstr(std::string("cl_khr_depth_images")));
auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (hwHelper.isMediaBlockIOSupported(*defaultHwInfo)) { if (hwHelper.isMediaBlockIOSupported(hwInfo)) {
EXPECT_THAT(extensions, testing::HasSubstr(std::string("cl_intel_media_block_io"))); EXPECT_THAT(extensions, testing::HasSubstr(std::string("cl_intel_media_block_io")));
} else {
EXPECT_THAT(extensions, testing::Not(testing::HasSubstr(std::string("cl_intel_media_block_io"))));
} }
} }