diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index ff2ef4257c..2293eb75cb 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -16,6 +16,7 @@ #include "shared/source/helpers/string.h" #include "shared/source/helpers/timestamp_packet.h" #include "shared/source/memory_manager/internal_allocation_storage.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/os_context.h" #include "shared/source/utilities/api_intercept.h" #include "shared/source/utilities/tag_allocator.h" @@ -796,8 +797,8 @@ bool CommandQueue::blitEnqueuePreferred(const CsrSelectionArgs &args) const { bool CommandQueue::blitEnqueueImageAllowed(const size_t *origin, const size_t *region, const Image &image) const { const auto &hwInfo = device->getHardwareInfo(); - const auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - auto blitEnqueueImageAllowed = hwHelper.isBlitterForImagesSupported(hwInfo); + const auto &hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); + auto blitEnqueueImageAllowed = hwInfoConfig->isBlitterForImagesSupported(); if (DebugManager.flags.EnableBlitterForEnqueueImageOperations.get() != -1) { blitEnqueueImageAllowed = DebugManager.flags.EnableBlitterForEnqueueImageOperations.get(); diff --git a/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp index a556d0a65a..2f3067f341 100644 --- a/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_copy_image_tests.cpp @@ -216,7 +216,7 @@ HWTEST_F(EnqueueCopyImageTest, givenDeviceWithBlitterSupportWhenEnqueueCopyImage DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(1); auto hwInfo = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); + const auto &hwInfoConfig = HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->capabilityTable.blitterOperationsSupported = true; size_t srcOrigin[] = {0, 0, 0}; size_t dstOrigin[] = {0, 0, 0}; @@ -246,7 +246,7 @@ HWTEST_F(EnqueueCopyImageTest, givenDeviceWithBlitterSupportWhenEnqueueCopyImage DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(-1); size_t region[] = {BlitterConstants::maxBlitWidth, BlitterConstants::maxBlitHeight, 1}; EnqueueCopyImageHelper<>::enqueueCopyImage(mockCmdQ.get(), srcImage.get(), dstImage.get(), srcOrigin, dstOrigin, region); - auto supportExpected = hwHelper.isBlitterForImagesSupported(*hwInfo); + auto supportExpected = hwInfoConfig->isBlitterForImagesSupported(); EXPECT_EQ(supportExpected, mockCmdQ->isBlitEnqueueImageAllowed); } { diff --git a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp index 94bd428bfa..a1af77f15a 100644 --- a/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp @@ -766,7 +766,7 @@ HWTEST_F(EnqueueReadImageTest, givenDeviceWithBlitterSupportWhenEnqueueReadImage DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(1); auto hwInfo = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); + const auto &hwInfoConfig = HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->capabilityTable.blitterOperationsSupported = true; REQUIRE_BLITTER_OR_SKIP(hwInfo); size_t origin[] = {0, 0, 0}; @@ -786,7 +786,7 @@ HWTEST_F(EnqueueReadImageTest, givenDeviceWithBlitterSupportWhenEnqueueReadImage DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(-1); size_t region[] = {BlitterConstants::maxBlitWidth, BlitterConstants::maxBlitHeight, 1}; EnqueueReadImageHelper<>::enqueueReadImage(mockCmdQ.get(), image.get(), CL_TRUE, origin, region); - auto supportExpected = hwHelper.isBlitterForImagesSupported(*hwInfo); + auto supportExpected = hwInfoConfig->isBlitterForImagesSupported(); EXPECT_EQ(supportExpected, mockCmdQ->isBlitEnqueueImageAllowed); } { diff --git a/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp index 6a9c2298ed..f30ca371c8 100644 --- a/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_write_image_tests.cpp @@ -215,7 +215,7 @@ HWTEST_F(EnqueueWriteImageTest, givenDeviceWithBlitterSupportWhenEnqueueWriteIma DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(1); auto hwInfo = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); + const auto &hwInfoConfig = HwInfoConfig::get(hwInfo->platform.eProductFamily); hwInfo->capabilityTable.blitterOperationsSupported = true; size_t origin[] = {0, 0, 0}; auto mockCmdQ = std::make_unique>(context, pClDevice, nullptr); @@ -234,7 +234,7 @@ HWTEST_F(EnqueueWriteImageTest, givenDeviceWithBlitterSupportWhenEnqueueWriteIma DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(-1); size_t region[] = {BlitterConstants::maxBlitWidth, BlitterConstants::maxBlitHeight, 1}; EnqueueWriteImageHelper<>::enqueueWriteImage(mockCmdQ.get(), image.get(), CL_FALSE, origin, region); - auto supportExpected = hwHelper.isBlitterForImagesSupported(*hwInfo); + auto supportExpected = hwInfoConfig->isBlitterForImagesSupported(); EXPECT_EQ(supportExpected, mockCmdQ->isBlitEnqueueImageAllowed); } { diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 9674de8c45..bb1282e0e3 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1208,8 +1208,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenGettingPlanarYuvHeigh } HWTEST_F(HwHelperTest, givenHwHelperWhenIsBlitterForImagesSupportedIsCalledThenFalseIsReturned) { - auto &helper = HwHelper::get(renderCoreFamily); - EXPECT_FALSE(helper.isBlitterForImagesSupported(*defaultHwInfo)); + const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); + EXPECT_FALSE(hwInfoConfig.isBlitterForImagesSupported()); } TEST_F(HwHelperTest, WhenGettingIsCpuImageTransferPreferredThenFalseIsReturned) { diff --git a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp index eb57c41ab4..59bde0c975 100644 --- a/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp +++ b/opencl/test/unit_test/xe_hp_core/hw_helper_tests_xe_hp_core.cpp @@ -309,8 +309,9 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, WhenGettingDeviceIpVersionThenMakeCorr EXPECT_EQ(ClHwHelperMock::makeDeviceIpVersion(12, 5, 1), ClHwHelper::get(renderCoreFamily).getDeviceIpVersion(*defaultHwInfo)); } -XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXeHpCoreWhenIsBlitterForImagesSupportedIsCalledThenTrueIsReturned) { - const auto &hwInfo = *defaultHwInfo; - auto &helper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - EXPECT_FALSE(helper.isBlitterForImagesSupported(hwInfo)); -} +XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXeHpCoreWhenIsBlitterForImagesSupportedIsCalledThenFalseIsReturned) { + HardwareInfo hwInfo = *defaultHwInfo; + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + + EXPECT_FALSE(hwInfoConfig.isBlitterForImagesSupported()); +} \ No newline at end of file diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 71372bb43b..2f6fdf6083 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -123,7 +123,6 @@ class HwHelper { virtual uint32_t getNumCacheRegions() const = 0; virtual bool isSubDeviceEngineSupported(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, aub_stream::EngineType engineType) const = 0; virtual uint32_t getPlanarYuvMaxHeight() const = 0; - virtual bool isBlitterForImagesSupported(const HardwareInfo &hwInfo) const = 0; virtual size_t getPreemptionAllocationAlignment() const = 0; virtual std::unique_ptr createTimestampPacketAllocator(const std::vector &rootDeviceIndices, MemoryManager *memoryManager, size_t initialTagCount, CommandStreamReceiverType csrType, @@ -339,8 +338,6 @@ class HwHelperHw : public HwHelper { uint32_t getPlanarYuvMaxHeight() const override; - bool isBlitterForImagesSupported(const HardwareInfo &hwInfo) const override; - size_t getPreemptionAllocationAlignment() const override; std::unique_ptr createTimestampPacketAllocator(const std::vector &rootDeviceIndices, MemoryManager *memoryManager, diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 4fd6d5f93c..51a07a155b 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -592,11 +592,6 @@ bool HwHelperHw::isSubDeviceEngineSupported(const HardwareInfo &hwInf return true; } -template -bool HwHelperHw::isBlitterForImagesSupported(const HardwareInfo &hwInfo) const { - return false; -} - template size_t HwHelperHw::getPreemptionAllocationAlignment() const { return 256 * MemoryConstants::kiloByte; diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index c25fea930a..bc2c8a9f05 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -74,6 +74,7 @@ class HwInfoConfig { virtual bool isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) const = 0; virtual bool is3DPipelineSelectWARequired() const = 0; virtual bool isStorageInfoAdjustmentRequired() const = 0; + virtual bool isBlitterForImagesSupported() const = 0; protected: virtual LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0; @@ -133,6 +134,7 @@ class HwInfoConfigHw : public HwInfoConfig { bool isForceEmuInt32DivRemSPWARequired(const HardwareInfo &hwInfo) const override; bool is3DPipelineSelectWARequired() const override; bool isStorageInfoAdjustmentRequired() const override; + bool isBlitterForImagesSupported() const override; protected: HwInfoConfigHw() = default; diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index d4179e67ff..60b1768646 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -251,4 +251,8 @@ bool HwInfoConfigHw::isStorageInfoAdjustmentRequired() const { return false; } +template +bool HwInfoConfigHw::isBlitterForImagesSupported() const { + return false; +} } // namespace NEO diff --git a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp index 64e914f2c1..91bbe5921a 100644 --- a/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/hw_helper_xe_hp_core.cpp @@ -117,11 +117,6 @@ std::string HwHelperHw::getExtensions() const { return extensions; } -template <> -bool HwHelperHw::isBlitterForImagesSupported(const HardwareInfo &hwInfo) const { - return false; -} - template <> void MemorySynchronizationCommands::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) { using PIPE_CONTROL = typename Family::PIPE_CONTROL; diff --git a/shared/test/common/mocks/mock_hw_info_config.cpp b/shared/test/common/mocks/mock_hw_info_config.cpp index f1d0067646..a59c4e1ed7 100644 --- a/shared/test/common/mocks/mock_hw_info_config.cpp +++ b/shared/test/common/mocks/mock_hw_info_config.cpp @@ -237,4 +237,9 @@ bool HwInfoConfigHw::isStorageInfoAdjustmentRequired() const { return false; } +template <> +bool HwInfoConfigHw::isBlitterForImagesSupported() const { + return false; +} + } //namespace NEO