From 86f63bb2ede948c7171e2a3911764ae3cc36a901 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Thu, 13 May 2021 14:58:26 +0000 Subject: [PATCH] Check supportsMediaBlock capability in ocloc Signed-off-by: Kamil Kopryk --- opencl/source/cl_device/cl_device_caps.cpp | 5 ++- opencl/source/gen11/hw_info_ehl.inl | 3 +- opencl/source/gen11/hw_info_icllp.inl | 1 + opencl/source/gen11/hw_info_lkf.inl | 3 +- opencl/source/gen12lp/hw_info_adls.inl | 3 +- opencl/source/gen12lp/hw_info_dg1.inl | 3 +- opencl/source/gen12lp/hw_info_rkl.inl | 3 +- opencl/source/gen12lp/hw_info_tgllp.inl | 3 +- opencl/source/gen8/hw_info_bdw.inl | 3 +- opencl/source/gen9/hw_info_bxt.inl | 3 +- opencl/source/gen9/hw_info_cfl.inl | 3 +- opencl/source/gen9/hw_info_glk.inl | 3 +- opencl/source/gen9/hw_info_kbl.inl | 3 +- opencl/source/gen9/hw_info_skl.inl | 3 +- opencl/source/platform/extensions.cpp | 2 +- .../unit_test/device/device_caps_tests.cpp | 25 ++++----------- .../gen11/test_device_caps_gen11.cpp | 6 +++- .../gen12lp/test_device_caps_gen12lp.inl | 6 +++- .../unit_test/gen8/test_device_caps_gen8.cpp | 6 +++- .../unit_test/gen9/test_device_caps_gen9.cpp | 6 +++- .../unit_test/helpers/hw_helper_tests.cpp | 13 -------- .../unit_test/platform/platform_tests.cpp | 32 ++++++++++++++++--- shared/source/helpers/hw_helper.h | 3 -- shared/source/helpers/hw_helper_base.inl | 5 --- shared/source/helpers/hw_info.h | 1 + 25 files changed, 82 insertions(+), 65 deletions(-) diff --git a/opencl/source/cl_device/cl_device_caps.cpp b/opencl/source/cl_device/cl_device_caps.cpp index 284f8f4fac..5015b36fd1 100644 --- a/opencl/source/cl_device/cl_device_caps.cpp +++ b/opencl/source/cl_device/cl_device_caps.cpp @@ -146,7 +146,7 @@ void ClDevice::initializeCaps() { if (supportsVme) { deviceExtensions += "cl_intel_spirv_device_side_avc_motion_estimation "; } - if (hwHelper.isMediaBlockIOSupported(hwInfo)) { + if (hwInfo.capabilityTable.supportsMediaBlock) { deviceExtensions += "cl_intel_spirv_media_block_io "; } deviceExtensions += "cl_intel_spirv_subgroups "; @@ -193,7 +193,7 @@ void ClDevice::initializeCaps() { deviceExtensions += "cl_khr_3d_image_writes "; } - if (hwHelper.isMediaBlockIOSupported(hwInfo)) { + if (hwInfo.capabilityTable.supportsMediaBlock) { deviceExtensions += "cl_intel_media_block_io "; } @@ -203,7 +203,6 @@ void ClDevice::initializeCaps() { } deviceExtensions += hwHelper.getExtensions(); - deviceInfo.deviceExtensions = deviceExtensions.c_str(); std::vector exposedBuiltinKernelsVector; diff --git a/opencl/source/gen11/hw_info_ehl.inl b/opencl/source/gen11/hw_info_ehl.inl index 1ccac40312..aaf1fd09d7 100644 --- a/opencl/source/gen11/hw_info_ehl.inl +++ b/opencl/source/gen11/hw_info_ehl.inl @@ -78,7 +78,8 @@ const RuntimeCapabilityTable EHL::capabilityTable{ false, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled false, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable EHL::workaroundTable = {}; diff --git a/opencl/source/gen11/hw_info_icllp.inl b/opencl/source/gen11/hw_info_icllp.inl index bc1458768a..9a7a77dd7f 100644 --- a/opencl/source/gen11/hw_info_icllp.inl +++ b/opencl/source/gen11/hw_info_icllp.inl @@ -80,6 +80,7 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{ true, // hostPtrTrackingEnabled true, // levelZeroSupported true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable ICLLP::workaroundTable = {}; diff --git a/opencl/source/gen11/hw_info_lkf.inl b/opencl/source/gen11/hw_info_lkf.inl index d718d2615e..b8cc1e8d72 100644 --- a/opencl/source/gen11/hw_info_lkf.inl +++ b/opencl/source/gen11/hw_info_lkf.inl @@ -78,7 +78,8 @@ const RuntimeCapabilityTable LKF::capabilityTable{ false, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled false, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable LKF::workaroundTable = {}; diff --git a/opencl/source/gen12lp/hw_info_adls.inl b/opencl/source/gen12lp/hw_info_adls.inl index 716cf91e10..8a63f2083e 100644 --- a/opencl/source/gen12lp/hw_info_adls.inl +++ b/opencl/source/gen12lp/hw_info_adls.inl @@ -80,7 +80,8 @@ const RuntimeCapabilityTable ADLS::capabilityTable{ false, // supportsIndependentForwardProgress false, // hostPtrTrackingEnabled true, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable ADLS::workaroundTable = {}; diff --git a/opencl/source/gen12lp/hw_info_dg1.inl b/opencl/source/gen12lp/hw_info_dg1.inl index c6215a304e..f0e19514e6 100644 --- a/opencl/source/gen12lp/hw_info_dg1.inl +++ b/opencl/source/gen12lp/hw_info_dg1.inl @@ -84,7 +84,8 @@ const RuntimeCapabilityTable DG1::capabilityTable{ false, // supportsIndependentForwardProgress false, // hostPtrTrackingEnabled true, // levelZeroSupported - false // isIntegratedDevice + false, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable DG1::workaroundTable = {}; diff --git a/opencl/source/gen12lp/hw_info_rkl.inl b/opencl/source/gen12lp/hw_info_rkl.inl index 7b1f1f7472..c3f608634d 100644 --- a/opencl/source/gen12lp/hw_info_rkl.inl +++ b/opencl/source/gen12lp/hw_info_rkl.inl @@ -76,7 +76,8 @@ const RuntimeCapabilityTable RKL::capabilityTable{ false, // supportsIndependentForwardProgress false, // hostPtrTrackingEnabled true, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable RKL::workaroundTable = {}; diff --git a/opencl/source/gen12lp/hw_info_tgllp.inl b/opencl/source/gen12lp/hw_info_tgllp.inl index 93e2454291..814088c35d 100644 --- a/opencl/source/gen12lp/hw_info_tgllp.inl +++ b/opencl/source/gen12lp/hw_info_tgllp.inl @@ -80,7 +80,8 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{ false, // supportsIndependentForwardProgress false, // hostPtrTrackingEnabled true, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable TGLLP::workaroundTable = {}; diff --git a/opencl/source/gen8/hw_info_bdw.inl b/opencl/source/gen8/hw_info_bdw.inl index a583347807..8ec80cdfdb 100644 --- a/opencl/source/gen8/hw_info_bdw.inl +++ b/opencl/source/gen8/hw_info_bdw.inl @@ -83,7 +83,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{ true, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled false, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable BDW::workaroundTable = {}; diff --git a/opencl/source/gen9/hw_info_bxt.inl b/opencl/source/gen9/hw_info_bxt.inl index b023c7cc26..950ce84bb0 100644 --- a/opencl/source/gen9/hw_info_bxt.inl +++ b/opencl/source/gen9/hw_info_bxt.inl @@ -80,7 +80,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{ false, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled false, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable BXT::workaroundTable = {}; diff --git a/opencl/source/gen9/hw_info_cfl.inl b/opencl/source/gen9/hw_info_cfl.inl index a2b2d83b5a..fd594b0f38 100644 --- a/opencl/source/gen9/hw_info_cfl.inl +++ b/opencl/source/gen9/hw_info_cfl.inl @@ -75,7 +75,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{ true, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled true, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable CFL::workaroundTable = {}; diff --git a/opencl/source/gen9/hw_info_glk.inl b/opencl/source/gen9/hw_info_glk.inl index cbf42faea5..5f1b5f8690 100644 --- a/opencl/source/gen9/hw_info_glk.inl +++ b/opencl/source/gen9/hw_info_glk.inl @@ -75,7 +75,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{ false, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled false, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable GLK::workaroundTable = {}; diff --git a/opencl/source/gen9/hw_info_kbl.inl b/opencl/source/gen9/hw_info_kbl.inl index dd5f88ace5..043b4e448e 100644 --- a/opencl/source/gen9/hw_info_kbl.inl +++ b/opencl/source/gen9/hw_info_kbl.inl @@ -75,7 +75,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{ true, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled true, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable KBL::workaroundTable = {}; diff --git a/opencl/source/gen9/hw_info_skl.inl b/opencl/source/gen9/hw_info_skl.inl index c720e75d4f..2d7b6c9db5 100644 --- a/opencl/source/gen9/hw_info_skl.inl +++ b/opencl/source/gen9/hw_info_skl.inl @@ -83,7 +83,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{ true, // supportsIndependentForwardProgress true, // hostPtrTrackingEnabled true, // levelZeroSupported - true // isIntegratedDevice + true, // isIntegratedDevice + true // supportsMediaBlock }; WorkaroundTable SKL::workaroundTable = {}; diff --git a/opencl/source/platform/extensions.cpp b/opencl/source/platform/extensions.cpp index 6c984bcbc2..3e66c5c552 100644 --- a/opencl/source/platform/extensions.cpp +++ b/opencl/source/platform/extensions.cpp @@ -55,7 +55,7 @@ std::string getExtensionsList(const HardwareInfo &hwInfo) { if (hwInfo.capabilityTable.supportsVme) { allExtensionsList += "cl_intel_spirv_device_side_avc_motion_estimation "; } - if (hwInfo.capabilityTable.supportsImages) { + if (hwInfo.capabilityTable.supportsMediaBlock) { allExtensionsList += "cl_intel_spirv_media_block_io "; } allExtensionsList += "cl_intel_spirv_subgroups "; diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 48d8f81c00..25f3daeaf0 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -569,7 +569,6 @@ TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReport auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); const auto &caps = device->getDeviceInfo(); 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"))); @@ -581,7 +580,7 @@ TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReport } else { EXPECT_THAT(caps.deviceExtensions, testing::Not(std::string("cl_khr_3d_image_writes"))); } - if (hwHelper.isMediaBlockIOSupported(*hwInfo)) { + if (hwInfo->capabilityTable.supportsMediaBlock) { 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")))); @@ -592,25 +591,21 @@ TEST_F(DeviceGetCapsTest, givenOpenCLVersion21WhenCapsAreCreatedThenDeviceReport } } -TEST_F(DeviceGetCapsTest, givenSupportImagesWhenCapsAreCreatedThenDeviceReportsClIntelSpirvMediaBlockIoExtensions) { +TEST_F(DeviceGetCapsTest, givenSupportMediaBlockWhenCapsAreCreatedThenDeviceReportsClIntelSpirvMediaBlockIoExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(21); HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.supportsImages = true; + hwInfo.capabilityTable.supportsMediaBlock = true; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); - - 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"))); - } + EXPECT_THAT(caps.deviceExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))); } -TEST_F(DeviceGetCapsTest, givenNotSupportImagesWhenCapsAreCreatedThenDeviceNotReportsClIntelSpirvMediaBlockIoExtensions) { +TEST_F(DeviceGetCapsTest, givenNotMediaBlockWhenCapsAreCreatedThenDeviceNotReportsClIntelSpirvMediaBlockIoExtensions) { DebugManagerStateRestore dbgRestorer; DebugManager.flags.ForceOCLVersion.set(21); HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.supportsImages = false; + hwInfo.capabilityTable.supportsMediaBlock = false; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); const auto &caps = device->getDeviceInfo(); EXPECT_THAT(caps.deviceExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")))); @@ -994,13 +989,6 @@ 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_depth_images"))); - - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - if (hwHelper.isMediaBlockIOSupported(hwInfo)) { - 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")))); - } } TEST_F(DeviceGetCapsTest, givenNotSupporteImagesWhenCreateExtentionsListThenDeviceNotReportsImagesExtensions) { @@ -1013,7 +1001,6 @@ TEST_F(DeviceGetCapsTest, givenNotSupporteImagesWhenCreateExtentionsListThenDevi EXPECT_THAT(extensions, testing::Not(testing::HasSubstr(std::string("cl_khr_image2d_from_buffer")))); EXPECT_THAT(extensions, testing::Not(testing::HasSubstr(std::string("cl_khr_depth_images")))); - EXPECT_THAT(extensions, testing::Not(testing::HasSubstr(std::string("cl_intel_media_block_io")))); } TEST_F(DeviceGetCapsTest, givenDeviceWhenGettingHostUnifiedMemoryCapThenItDependsOnLocalMemory) { diff --git a/opencl/test/unit_test/gen11/test_device_caps_gen11.cpp b/opencl/test/unit_test/gen11/test_device_caps_gen11.cpp index 8def84c03f..e7512cf3a6 100644 --- a/opencl/test/unit_test/gen11/test_device_caps_gen11.cpp +++ b/opencl/test/unit_test/gen11/test_device_caps_gen11.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -65,6 +65,10 @@ GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingImageSupportThenReturnTrue) { EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages); } +GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingMediaBlockSupportThenReturnTrue) { + EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock); +} + GEN11TEST_F(Gen11DeviceCaps, givenGen11WhenCheckingCoherencySupportThenReturnFalse) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency); } diff --git a/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl b/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl index 796de82f25..0c17b423d7 100644 --- a/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020 Intel Corporation + * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -90,6 +90,10 @@ GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingImageSupportThenReturnT EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages); } +GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingMediaBlockSupportThenReturnTrue) { + EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock); +} + GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingCoherencySupportThenReturnFalse) { EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency); } diff --git a/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp b/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp index 09c2742f05..ab254b22de 100644 --- a/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp +++ b/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -78,3 +78,7 @@ GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckFtrSupportsInteger64BitAtomicsThenR GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingImageSupportThenReturnTrue) { EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages); } + +GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckingMediaBlockSupportThenReturnTrue) { + EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock); +} diff --git a/opencl/test/unit_test/gen9/test_device_caps_gen9.cpp b/opencl/test/unit_test/gen9/test_device_caps_gen9.cpp index 8da3b4f314..371723096f 100644 --- a/opencl/test/unit_test/gen9/test_device_caps_gen9.cpp +++ b/opencl/test/unit_test/gen9/test_device_caps_gen9.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017-2020 Intel Corporation + * Copyright (C) 2017-2021 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -91,3 +91,7 @@ GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckBlitterOperationsSupportThenReturnF GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckingImageSupportThenReturnTrue) { EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages); } + +GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckingMediaBlockSupportThenReturnTrue) { + EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsMediaBlock); +} diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 6ddf599438..1543e6bf6c 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1013,19 +1013,6 @@ HWTEST_F(HwHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAccessMod EXPECT_EQ(LocalMemoryAccessMode::CpuAccessDisallowed, hwHelper.getLocalMemoryAccessMode(*defaultHwInfo)); } -HWTEST_F(HwHelperTest, WhenIsMediaBlockIOSupportedThenReturnCorrectResult) { - auto &helper = HwHelper::get(renderCoreFamily); - HardwareInfo hwInfo = *defaultHwInfo; - { - hwInfo.capabilityTable.supportsImages = true; - EXPECT_TRUE(helper.isMediaBlockIOSupported(hwInfo)); - } - { - hwInfo.capabilityTable.supportsImages = false; - EXPECT_FALSE(helper.isMediaBlockIOSupported(hwInfo)); - } -} - HWTEST2_F(HwHelperTest, givenDefaultHwHelperHwWhenGettingIsBlitCopyRequiredForLocalMemoryThenFalseIsReturned, IsAtMostGen11) { auto &helper = HwHelper::get(renderCoreFamily); MockGraphicsAllocation graphicsAllocation; diff --git a/opencl/test/unit_test/platform/platform_tests.cpp b/opencl/test/unit_test/platform/platform_tests.cpp index 44d134e5eb..4cb90400e4 100644 --- a/opencl/test/unit_test/platform/platform_tests.cpp +++ b/opencl/test/unit_test/platform/platform_tests.cpp @@ -288,7 +288,7 @@ TEST_F(PlatformTest, givenSupportingCl21WhenPlatformSupportsFp64ThenFillMatching } else { EXPECT_THAT(compilerExtensions, testing::Not(::testing::HasSubstr(std::string("cl_intel_spirv_device_side_avc_motion_estimation")))); } - if (hwInfo->capabilityTable.supportsImages) { + if (hwInfo->capabilityTable.supportsMediaBlock) { EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))); } else { EXPECT_THAT(compilerExtensions, testing::Not(::testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")))); @@ -347,9 +347,9 @@ TEST_F(PlatformTest, givenFtrSupportAtomicsWhenCreateExtentionsListThenGetMatchi } } -TEST_F(PlatformTest, givenSupporteImagesAndClVersion21WhenCreateExtentionsListThenDeviceReportsSpritvMediaBlockIoExtension) { +TEST_F(PlatformTest, givenSupportedMediaBlockAndClVersion21WhenCreateExtentionsListThenDeviceReportsSpritvMediaBlockIoExtension) { HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.supportsImages = true; + hwInfo.capabilityTable.supportsMediaBlock = true; hwInfo.capabilityTable.clVersionSupport = 21; hwInfo.capabilityTable.supportsOcl21Features = true; std::string extensionsList = getExtensionsList(hwInfo); @@ -360,9 +360,9 @@ TEST_F(PlatformTest, givenSupporteImagesAndClVersion21WhenCreateExtentionsListTh EXPECT_THAT(compilerExtensions, testing::HasSubstr(std::string("cl_intel_spirv_media_block_io"))); } -TEST_F(PlatformTest, givenNotSupporteImagesAndClVersion21WhenCreateExtentionsListThenDeviceNotReportsSpritvMediaBlockIoExtension) { +TEST_F(PlatformTest, givenNotSupportedMediaBlockAndClVersion21WhenCreateExtentionsListThenDeviceNotReportsSpritvMediaBlockIoExtension) { HardwareInfo hwInfo = *defaultHwInfo; - hwInfo.capabilityTable.supportsImages = false; + hwInfo.capabilityTable.supportsMediaBlock = false; hwInfo.capabilityTable.clVersionSupport = 21; std::string extensionsList = getExtensionsList(hwInfo); OpenClCFeaturesContainer features; @@ -372,6 +372,28 @@ TEST_F(PlatformTest, givenNotSupporteImagesAndClVersion21WhenCreateExtentionsLis EXPECT_THAT(compilerExtensions, testing::Not(testing::HasSubstr(std::string("cl_intel_spirv_media_block_io")))); } +TEST_F(PlatformTest, givenSupportedImagesWhenCreateExtentionsListThenDeviceNotReportsKhr3DImageWritesExtension) { + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.capabilityTable.supportsImages = true; + std::string extensionsList = getExtensionsList(hwInfo); + OpenClCFeaturesContainer features; + getOpenclCFeaturesList(*defaultHwInfo, features); + std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); + + EXPECT_THAT(compilerExtensions, testing::HasSubstr(std::string("cl_khr_3d_image_writes"))); +} + +TEST_F(PlatformTest, givenNotSupportedImagesWhenCreateExtentionsListThenDeviceNotReportsKhr3DImageWritesExtension) { + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.capabilityTable.supportsImages = false; + std::string extensionsList = getExtensionsList(hwInfo); + OpenClCFeaturesContainer features; + getOpenclCFeaturesList(*defaultHwInfo, features); + std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str(), features); + + EXPECT_THAT(compilerExtensions, testing::Not(testing::HasSubstr(std::string("cl_khr_3d_image_writes")))); +} + TEST(PlatformConstructionTest, givenPlatformConstructorWhenItIsCalledTwiceThenTheSamePlatformIsReturned) { platformsImpl->clear(); auto platform1 = constructPlatform(); diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 8ea874f686..26b78f10a6 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -132,7 +132,6 @@ class HwHelper { virtual bool packedFormatsSupported() const = 0; virtual bool isCooperativeDispatchSupported(const EngineGroupType engineGroupType, const PRODUCT_FAMILY productFamily) const = 0; virtual size_t getMaxFillPaternSizeForCopyEngine() const = 0; - virtual bool isMediaBlockIOSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isCopyOnlyEngineType(EngineGroupType type) const = 0; virtual void adjustAddressWidthForCanonize(uint32_t &addressWidth) const = 0; virtual bool isSipWANeeded(const HardwareInfo &hwInfo) const = 0; @@ -341,8 +340,6 @@ class HwHelperHw : public HwHelper { size_t getMaxFillPaternSizeForCopyEngine() const override; - bool isMediaBlockIOSupported(const HardwareInfo &hwInfo) const override; - bool isKmdMigrationSupported(const HardwareInfo &hwInfo) const override; bool isNewResidencyModelSupported() const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 735cc6a1fa..a881f4ce5d 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -549,11 +549,6 @@ bool HwHelperHw::isCooperativeDispatchSupported(const EngineGroupType return true; } -template -bool HwHelperHw::isMediaBlockIOSupported(const HardwareInfo &hwInfo) const { - return hwInfo.capabilityTable.supportsImages; -} - template bool HwHelperHw::isKmdMigrationSupported(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index e472adb9d2..9981f5ed3a 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -64,6 +64,7 @@ struct RuntimeCapabilityTable { bool hostPtrTrackingEnabled; bool levelZeroSupported; bool isIntegratedDevice; + bool supportsMediaBlock; }; struct HardwareCapabilities {