diff --git a/opencl/test/unit_test/command_queue/command_queue_tests.cpp b/opencl/test/unit_test/command_queue/command_queue_tests.cpp index 4b10de2cb6..0bf5d97fa5 100644 --- a/opencl/test/unit_test/command_queue/command_queue_tests.cpp +++ b/opencl/test/unit_test/command_queue/command_queue_tests.cpp @@ -12,6 +12,7 @@ #include "shared/source/helpers/timestamp_packet.h" #include "shared/source/memory_manager/internal_allocation_storage.h" #include "shared/source/memory_manager/memory_manager.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/unit_test_helper.h" #include "shared/test/common/helpers/variable_backup.h" @@ -1144,7 +1145,7 @@ TEST(CommandQueue, givenBlitterOperationsSupportedWhenCreatingQueueThenTimestamp MockContext context{}; HardwareInfo *hwInfo = context.getDevice(0)->getRootDeviceEnvironment().getMutableHardwareInfo(); - if (!HwHelper::get(hwInfo->platform.eDisplayCoreFamily).obtainBlitterPreference(*hwInfo)) { + if (!HwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->obtainBlitterPreference(*defaultHwInfo.get())) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp b/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp index b65ed2bd2c..33cd0f2f1f 100644 --- a/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp +++ b/opencl/test/unit_test/gen12lp/dg1/hw_helper_tests_dg1.cpp @@ -93,12 +93,6 @@ DG1TEST_F(HwHelperTestDg1, givenDg1WhenSteppingB0ThenIntegerDivisionEmulationIsN EXPECT_FALSE(helper.isForceEmuInt32DivRemSPWARequired(hardwareInfo)); } -DG1TEST_F(HwHelperTestDg1, givenDg1WhenObtainingBlitterPreferenceThenReturnFalse) { - auto &helper = HwHelper::get(renderCoreFamily); - - EXPECT_FALSE(helper.obtainBlitterPreference(hardwareInfo)); -} - DG1TEST_F(HwHelperTestDg1, givenDg1WhenGettingLocalMemoryAccessModeThenReturnCpuAccessDefault) { struct MockHwHelper : HwHelperHw { using HwHelper::getDefaultLocalMemoryAccessMode; diff --git a/opencl/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp b/opencl/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp index 480064ecc6..7d44d5a5fa 100644 --- a/opencl/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp +++ b/opencl/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/helpers/hw_helper.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" #include "opencl/source/helpers/hardware_commands_helper.h" @@ -78,3 +79,10 @@ DG1TEST_F(Dg1HwInfo, whenPlatformIsDg1ThenExpectSvmIsSet) { const HardwareInfo &hardwareInfo = DG1::hwInfo; EXPECT_TRUE(hardwareInfo.capabilityTable.ftrSvm); } + +DG1TEST_F(Dg1HwInfo, givenDg1WhenObtainingBlitterPreferenceThenReturnFalse) { + const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + const auto &hardwareInfo = DG1::hwInfo; + + EXPECT_FALSE(hwInfoConfig.obtainBlitterPreference(hardwareInfo)); +} diff --git a/opencl/test/unit_test/gen12lp/tgllp/test_hw_helper_tgllp.cpp b/opencl/test/unit_test/gen12lp/tgllp/test_hw_helper_tgllp.cpp index 41c0e64712..1429d96a1d 100644 --- a/opencl/test/unit_test/gen12lp/tgllp/test_hw_helper_tgllp.cpp +++ b/opencl/test/unit_test/gen12lp/tgllp/test_hw_helper_tgllp.cpp @@ -81,12 +81,6 @@ TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpAndVariousSteppingsWhenGettingIsWorka } } -TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpWhenObtainingBlitterPreferenceThenReturnFalse) { - auto &helper = HwHelper::get(renderCoreFamily); - - EXPECT_FALSE(helper.obtainBlitterPreference(hardwareInfo)); -} - TGLLPTEST_F(HwHelperTestGen12Lp, givenTgllpWhenGettingLocalMemoryAccessModeThenReturnCpuAccessDefault) { struct MockHwHelper : HwHelperHw { using HwHelper::getDefaultLocalMemoryAccessMode; diff --git a/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp b/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp index 9efd612a67..d8d19ec22f 100644 --- a/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp +++ b/opencl/test/unit_test/gen12lp/tgllp/test_hw_info_config_tgllp.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/os_interface/device_factory.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/mocks/mock_execution_environment.h" @@ -164,3 +165,10 @@ TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWhenPrepareDevice memoryOperationHandlers.insert(memoryOperationInterface); } } + +TGLLPTEST_F(TgllpHwInfo, givenTgllpWhenObtainingBlitterPreferenceThenReturnFalse) { + const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + const auto &hardwareInfo = *defaultHwInfo; + + EXPECT_FALSE(hwInfoConfig.obtainBlitterPreference(hardwareInfo)); +} diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 87481b6860..85da055646 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1131,7 +1131,7 @@ HWTEST2_F(HwInfoConfigCommonTest, givenBlitterPreferenceWhenEnablingBlitterOpera hwInfoConfig->configureHardwareCustom(&hardwareInfo, nullptr); - const auto expectedBlitterSupport = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily).obtainBlitterPreference(hardwareInfo); + const auto expectedBlitterSupport = hwInfoConfig->obtainBlitterPreference(hardwareInfo); EXPECT_EQ(expectedBlitterSupport, hardwareInfo.capabilityTable.blitterOperationsSupported); } diff --git a/opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp b/opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp index a701da2507..0c869da8bd 100644 --- a/opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp +++ b/opencl/test/unit_test/os_interface/linux/hw_info_config_linux_tests.cpp @@ -111,6 +111,11 @@ uint32_t HwInfoConfigHw::getMaxThreadsForWorkgroup(const HardwareI template <> void HwInfoConfigHw::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) {} + +template <> +bool HwInfoConfigHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { + return false; +} } // namespace NEO struct DummyHwConfig : HwInfoConfigHw { @@ -626,3 +631,8 @@ HWTEST2_F(HwConfigLinux, GivenDifferentValuesFromTopologyQueryWhenConfiguringHwI EXPECT_EQ(0, ret); EXPECT_EQ(8u, outHwInfo.gtSystemInfo.MaxEuPerSubSlice); } + +HWTEST_F(HwInfoConfigTestLinuxDummy, givenHardwareInfoWhenCallingObtainBlitterPreferenceThenFalseIsReturned) { + bool ret = hwConfig.obtainBlitterPreference(outHwInfo); + EXPECT_FALSE(ret); +} diff --git a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp index c980a207ac..a77b5950bc 100644 --- a/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/hw_info_config_win_tests.cpp @@ -90,6 +90,11 @@ uint32_t HwInfoConfigHw::getMaxThreadsForWorkgroup(const HardwareI template <> void HwInfoConfigHw::setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) {} +template <> +bool HwInfoConfigHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { + return false; +} + HwInfoConfigTestWindows::HwInfoConfigTestWindows() { this->executionEnvironment = std::make_unique(); this->rootDeviceEnvironment = std::make_unique(*executionEnvironment); @@ -167,4 +172,9 @@ HWTEST_F(HwInfoConfigTestWindows, givenFtrIaCoherencyFlagWhenConfiguringHwInfoTh EXPECT_EQ(initialCoherencyStatus, outHwInfo.capabilityTable.ftrSupportsCoherency); } +HWTEST_F(HwInfoConfigTestWindows, givenHardwareInfoWhenCallingObtainBlitterPreferenceThenFalseIsReturned) { + bool ret = hwConfig.obtainBlitterPreference(outHwInfo); + EXPECT_FALSE(ret); +} + } // namespace NEO diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index 312fb8a77c..f8f404c2a3 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -68,7 +68,6 @@ class HwHelper { virtual bool hvAlign4Required() const = 0; virtual bool preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const = 0; virtual bool isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const = 0; - virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0; virtual bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) = 0; virtual bool allowRenderCompression(const HardwareInfo &hwInfo) const = 0; virtual bool allowStatelessCompression(const HardwareInfo &hwInfo) const = 0; @@ -236,8 +235,6 @@ class HwHelperHw : public HwHelper { bool isBufferSizeSuitableForRenderCompression(const size_t size, const HardwareInfo &hwInfo) const override; - bool obtainBlitterPreference(const HardwareInfo &hwInfo) const override; - bool checkResourceCompatibility(GraphicsAllocation &graphicsAllocation) override; bool timestampPacketWriteSupported() const override; diff --git a/shared/source/helpers/hw_helper_bdw_and_later.inl b/shared/source/helpers/hw_helper_bdw_and_later.inl index db3effa132..dac192ffda 100644 --- a/shared/source/helpers/hw_helper_bdw_and_later.inl +++ b/shared/source/helpers/hw_helper_bdw_and_later.inl @@ -50,11 +50,6 @@ bool HwHelperHw::timestampPacketWriteSupported() const { return false; } -template -bool HwHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { - return false; -} - template const HwHelper::EngineInstancesContainer HwHelperHw::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const { return { diff --git a/shared/source/helpers/hw_helper_xehp_and_later.inl b/shared/source/helpers/hw_helper_xehp_and_later.inl index 6a0c735a93..767717aa93 100644 --- a/shared/source/helpers/hw_helper_xehp_and_later.inl +++ b/shared/source/helpers/hw_helper_xehp_and_later.inl @@ -64,11 +64,6 @@ bool HwHelperHw::timestampPacketWriteSupported() const { return true; } -template -bool HwHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { - return true; -} - template const HwHelper::EngineInstancesContainer HwHelperHw::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const { auto defaultEngine = getChosenEngineType(hwInfo); diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index b6cfe74908..d29a828a4a 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -44,6 +44,8 @@ class HwInfoConfig { virtual uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const = 0; virtual uint32_t getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const = 0; virtual void setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) = 0; + virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0; + uint32_t threadsPerEu; }; @@ -70,6 +72,7 @@ class HwInfoConfigHw : public HwInfoConfig { uint32_t getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const override; uint32_t getMaxThreadsForWorkgroup(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice) const override; void setForceNonCoherent(void *const commandPtr, const StateComputeModeProperties &properties) override; + bool obtainBlitterPreference(const HardwareInfo &hwInfo) 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 174d14e581..92ddae242c 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -42,7 +42,7 @@ void HwInfoConfigHw::adjustSamplerState(void *sampler, const Hardwar template void HwInfoConfigHw::enableBlitterOperationsSupport(HardwareInfo *hwInfo) { - hwInfo->capabilityTable.blitterOperationsSupported = HwHelper::get(hwInfo->platform.eRenderCoreFamily).obtainBlitterPreference(*hwInfo); + hwInfo->capabilityTable.blitterOperationsSupported = obtainBlitterPreference(*hwInfo); if (DebugManager.flags.EnableBlitterOperationsSupport.get() != -1) { hwInfo->capabilityTable.blitterOperationsSupported = !!DebugManager.flags.EnableBlitterOperationsSupport.get(); diff --git a/shared/source/os_interface/hw_info_config_bdw_and_later.inl b/shared/source/os_interface/hw_info_config_bdw_and_later.inl index f721178a8b..e83e12f85a 100644 --- a/shared/source/os_interface/hw_info_config_bdw_and_later.inl +++ b/shared/source/os_interface/hw_info_config_bdw_and_later.inl @@ -30,4 +30,9 @@ uint32_t HwInfoConfigHw::getMaxThreadsForWorkgroupInDSSOrSS(const Ha return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerSubSlice); } +template +bool HwInfoConfigHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { + return false; +} + } // namespace NEO diff --git a/shared/source/os_interface/hw_info_config_xehp_and_later.inl b/shared/source/os_interface/hw_info_config_xehp_and_later.inl index 1e4565192a..9e2cead084 100644 --- a/shared/source/os_interface/hw_info_config_xehp_and_later.inl +++ b/shared/source/os_interface/hw_info_config_xehp_and_later.inl @@ -32,4 +32,9 @@ uint32_t HwInfoConfigHw::getMaxThreadsForWorkgroupInDSSOrSS(const Ha return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); } +template +bool HwInfoConfigHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { + return true; +} + } // namespace NEO