diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 3b53162dc8..d579ae5db8 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -24,6 +24,7 @@ #include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/memory_manager/memory_manager.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/page_fault_manager/cpu_page_fault_manager.h" #include "shared/source/program/sync_buffer_handler.h" #include "shared/source/program/sync_buffer_handler.inl" @@ -2156,7 +2157,8 @@ void CommandListCoreFamily::updateStreamProperties(Kernel &kernel auto &hwInfo = device->getHwInfo(); auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); - auto disableOverdispatch = hwHelper.isDisableOverdispatchAvailable(hwInfo); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); + auto disableOverdispatch = hwInfoConfig.isDisableOverdispatchAvailable(hwInfo); if (!containsAnyKernel) { requiredStreamState.frontEndState.setProperties(isCooperative, disableOverdispatch, -1, hwInfo); diff --git a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl index 4446a3751c..df4ea58305 100644 --- a/level_zero/core/source/cmdqueue/cmdqueue_hw.inl +++ b/level_zero/core/source/cmdqueue/cmdqueue_hw.inl @@ -21,6 +21,7 @@ #include "shared/source/helpers/preamble.h" #include "shared/source/memory_manager/memory_manager.h" #include "shared/source/memory_manager/residency_container.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/os_context.h" #include "shared/source/page_fault_manager/cpu_page_fault_manager.h" #include "shared/source/unified_memory/unified_memory.h" @@ -214,8 +215,8 @@ ze_result_t CommandQueueHw::executeCommandLists( perThreadScratchSpaceSize); auto &streamProperties = csr->getStreamProperties(); - auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); - auto disableOverdispatch = hwHelper.isDisableOverdispatchAvailable(hwInfo); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); + auto disableOverdispatch = hwInfoConfig.isDisableOverdispatchAvailable(hwInfo); auto isEngineInstanced = csr->getOsContext().isEngineInstanced(); bool isPatchingVfeStateAllowed = NEO::DebugManager.flags.AllowPatchingVfeStateInCommandLists.get(); if (!isPatchingVfeStateAllowed) { diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp index 135aaa3b2d..76127e08df 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_append_launch_kernel_1.cpp @@ -8,6 +8,7 @@ #include "shared/source/command_container/command_encoder.h" #include "shared/source/helpers/preamble.h" #include "shared/source/helpers/register_offsets.h" +#include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/cmd_parse/gen_cmd_parse.h" #include "test.h" @@ -1070,8 +1071,8 @@ HWTEST2_F(CommandListAppendLaunchKernel, whenUpdateStreamPropertiesIsCalledThenR EXPECT_EQ(-1, pCommandList->requiredStreamState.frontEndState.disableOverdispatch.value); EXPECT_EQ(-1, pCommandList->finalStreamState.frontEndState.disableOverdispatch.value); - auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); - int32_t expectedDisableOverdispatch = hwHelper.isDisableOverdispatchAvailable(*defaultHwInfo); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(defaultHwInfo->platform.eProductFamily); + int32_t expectedDisableOverdispatch = hwInfoConfig.isDisableOverdispatchAvailable(*defaultHwInfo); pCommandList->updateStreamProperties(kernel, false, false); EXPECT_EQ(expectedDisableOverdispatch, pCommandList->requiredStreamState.frontEndState.disableOverdispatch.value); diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp index 6c3b70ffc3..8b9fa518b5 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_1_tests.cpp @@ -576,7 +576,6 @@ HWTEST2_F(CommandStreamReceiverHwTest, whenProgramVFEStateIsCalledThenCorrectCom UltDeviceFactory deviceFactory{1, 0}; auto pDevice = deviceFactory.rootDevices[0]; auto pHwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); - const auto &hwHelper = HwHelper::get(pHwInfo->platform.eRenderCoreFamily); const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily); uint8_t memory[1 * KB]; @@ -596,7 +595,7 @@ HWTEST2_F(CommandStreamReceiverHwTest, whenProgramVFEStateIsCalledThenCorrectCom mockCsr->programVFEState(commandStream, flags, 10); auto pCommand = reinterpret_cast(&memory); - auto expectedDisableOverdispatch = hwHelper.isDisableOverdispatchAvailable(*pHwInfo); + auto expectedDisableOverdispatch = hwInfoConfig.isDisableOverdispatchAvailable(*pHwInfo); EXPECT_EQ(expectedDisableOverdispatch, pCommand->getComputeOverdispatchDisable()); } { diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 6e5a640272..79f1e2f4ee 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1243,11 +1243,6 @@ HWTEST_F(HwHelperTest, givenHwHelperWhenIsBlitterForImagesSupportedIsCalledThenF EXPECT_FALSE(helper.isBlitterForImagesSupported(*defaultHwInfo)); } -HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { - auto &helper = HwHelper::get(renderCoreFamily); - EXPECT_FALSE(helper.isDisableOverdispatchAvailable(*defaultHwInfo)); -} - TEST_F(HwHelperTest, WhenGettingIsCpuImageTransferPreferredThenFalseIsReturned) { REQUIRE_IMAGES_OR_SKIP(defaultHwInfo); auto &hwHelper = HwHelper::get(renderCoreFamily); diff --git a/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp b/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp index bb59d5ea92..62534a0777 100644 --- a/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp +++ b/opencl/test/unit_test/os_interface/hw_info_config_tests.cpp @@ -228,3 +228,8 @@ HWTEST_F(HwInfoConfigTest, whenCallingGetDeviceMemoryNameThenDdrIsReturned) { auto deviceMemoryName = hwInfoConfig.getDeviceMemoryName(); EXPECT_THAT(deviceMemoryName, testing::HasSubstr(std::string("DDR"))); } + +HWCMDTEST_F(IGFX_GEN8_CORE, HwInfoConfigTest, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { + const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily); + EXPECT_FALSE(hwInfoConfig.isDisableOverdispatchAvailable(pInHwInfo)); +} 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 17a53e96f5..ea317033cd 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 @@ -357,13 +357,3 @@ XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenXeHpCoreWhenIsBlitterForImagesSup auto &helper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily); EXPECT_FALSE(helper.isBlitterForImagesSupported(hwInfo)); } - -XE_HP_CORE_TEST_F(HwHelperTestXE_HP_CORE, givenHwHelperWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { - auto &hwHelper = HwHelper::get(renderCoreFamily); - const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); - auto hwInfo = *defaultHwInfo; - EXPECT_FALSE(hwHelper.isDisableOverdispatchAvailable(hwInfo)); - - hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); - EXPECT_TRUE(hwHelper.isDisableOverdispatchAvailable(hwInfo)); -} diff --git a/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl b/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl index 2c30c93e21..fd89c22908 100644 --- a/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl +++ b/opencl/test/unit_test/xe_hp_core/xehp/test_hw_info_config_xehp.inl @@ -86,3 +86,12 @@ XEHPTEST_F(XeHPHwHelperTest, givenXeHPMultiConfigWhenAllowRenderCompressionIsCal hwInfo.gtSystemInfo.EUCount = 256u; EXPECT_FALSE(helper.allowRenderCompression(hwInfo)); } + +XEHPTEST_F(XeHPHwInfoConfig, givenHwInfoConfigWhenAdditionalKernelExecInfoSupportCheckedThenCorrectValueIsReturned) { + const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); + auto hwInfo = *defaultHwInfo; + EXPECT_FALSE(hwInfoConfig.isDisableOverdispatchAvailable(hwInfo)); + + hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(REVISION_B, hwInfo); + EXPECT_TRUE(hwInfoConfig.isDisableOverdispatchAvailable(hwInfo)); +} diff --git a/shared/source/command_stream/command_stream_receiver_hw_base.inl b/shared/source/command_stream/command_stream_receiver_hw_base.inl index 8b39f43c5a..512240835c 100644 --- a/shared/source/command_stream/command_stream_receiver_hw_base.inl +++ b/shared/source/command_stream/command_stream_receiver_hw_base.inl @@ -31,6 +31,7 @@ #include "shared/source/indirect_heap/indirect_heap.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/source/os_interface/os_context.h" #include "shared/source/utilities/tag_allocator.h" @@ -937,9 +938,10 @@ inline void CommandStreamReceiverHw::programVFEState(LinearStream &cs } auto &hwInfo = peekHwInfo(); auto &hwHelper = NEO::HwHelper::get(hwInfo.platform.eRenderCoreFamily); + const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily); auto engineGroupType = hwHelper.getEngineGroupType(getOsContext().getEngineType(), getOsContext().getEngineUsage(), hwInfo); auto pVfeState = PreambleHelper::getSpaceForVfeState(&csr, hwInfo, engineGroupType); - auto disableOverdispatch = hwHelper.isDisableOverdispatchAvailable(hwInfo) && + auto disableOverdispatch = hwInfoConfig.isDisableOverdispatchAvailable(hwInfo) && (dispatchFlags.additionalKernelExecInfo != AdditionalKernelExecInfo::NotSet); streamProperties.frontEndState.setProperties(lastKernelExecutionType == KernelExecutionType::Concurrent, disableOverdispatch, osContext->isEngineInstanced(), hwInfo); diff --git a/shared/source/helpers/hw_helper.h b/shared/source/helpers/hw_helper.h index f9250a02fb..aaa9dd17a4 100644 --- a/shared/source/helpers/hw_helper.h +++ b/shared/source/helpers/hw_helper.h @@ -129,7 +129,6 @@ class HwHelper { virtual size_t getMaxFillPaternSizeForCopyEngine() const = 0; virtual bool isCopyOnlyEngineType(EngineGroupType type) const = 0; virtual bool isSipWANeeded(const HardwareInfo &hwInfo) const = 0; - virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0; virtual bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const = 0; virtual bool isKmdMigrationSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isNewResidencyModelSupported() const = 0; @@ -352,8 +351,6 @@ class HwHelperHw : public HwHelper { bool isSipWANeeded(const HardwareInfo &hwInfo) const override; - bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override; - bool isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const override; aub_stream::MMIOList getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const override; diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 3dc5bb579e..339da6517c 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -432,11 +432,6 @@ inline bool HwHelperHw::isBlitCopyRequiredForLocalMemory(const Hardwa (getLocalMemoryAccessMode(hwInfo) == LocalMemoryAccessMode::CpuAccessDisallowed || !allocation.isAllocationLockable()); } -template -bool HwHelperHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { - return false; -} - template std::unique_ptr HwHelperHw::createTimestampPacketAllocator(const std::vector &rootDeviceIndices, MemoryManager *memoryManager, size_t initialTagCount, CommandStreamReceiverType csrType, DeviceBitfield deviceBitfield) const { diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index d62d9e6787..56bb8e4a64 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -54,6 +54,7 @@ class HwInfoConfig { virtual void setAdditionalPipelineSelectFields(void *pipelineSelectCmd, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) = 0; virtual bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0; virtual std::string getDeviceMemoryName() const = 0; + virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0; uint32_t threadsPerEu; }; @@ -90,6 +91,7 @@ class HwInfoConfigHw : public HwInfoConfig { void setAdditionalPipelineSelectFields(void *pipelineSelectCmd, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) override; bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const override; std::string getDeviceMemoryName() const override; + bool isDisableOverdispatchAvailable(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 4332d81bba..553302e653 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -151,4 +151,8 @@ std::string HwInfoConfigHw::getDeviceMemoryName() const { return "DDR"; } +template +bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { + return false; +} } // namespace NEO diff --git a/shared/source/xe_hp_core/command_encoder_xe_hp_core.cpp b/shared/source/xe_hp_core/command_encoder_xe_hp_core.cpp index b6782679a4..c2200df9ec 100644 --- a/shared/source/xe_hp_core/command_encoder_xe_hp_core.cpp +++ b/shared/source/xe_hp_core/command_encoder_xe_hp_core.cpp @@ -44,8 +44,8 @@ void EncodeDispatchKernel::programBarrierEnable(INTERFACE_DESCRIPTOR_DAT template <> void EncodeDispatchKernel::adjustInterfaceDescriptorData(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, const HardwareInfo &hwInfo) { - auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily); - if (hwHelper.isDisableOverdispatchAvailable(hwInfo)) { + const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); + if (hwInfoConfig.isDisableOverdispatchAvailable(hwInfo)) { interfaceDescriptor.setThreadGroupDispatchSize(3u); } 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 4a9dd8294a..8ad45096c7 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 @@ -161,11 +161,6 @@ bool HwHelperHw::isBlitterForImagesSupported(const HardwareInfo &hwInfo) return false; } -template <> -bool HwHelperHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { - return (HwInfoConfig::get(hwInfo.platform.eProductFamily)->getSteppingFromHwRevId(hwInfo) >= REVISION_B); -} - template <> void MemorySynchronizationCommands::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) { using PIPE_CONTROL = typename Family::PIPE_CONTROL; diff --git a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp index 8d4de42860..86f3f98a8e 100644 --- a/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/linux/hw_info_config_xe_hp_sdv.cpp @@ -11,11 +11,14 @@ #include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.inl" #include "shared/source/os_interface/hw_info_config_xehp_and_later.inl" -#include "shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl" namespace NEO { +constexpr static auto gfxProduct = IGFX_XE_HP_SDV; + +#include "shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl" + template <> -int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { +int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); if (hwHelper.allowRenderCompression(*hwInfo)) { @@ -37,7 +40,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo } template <> -bool HwInfoConfigHw::getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) { +bool HwInfoConfigHw::getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) { HwHelper &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); if (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, *hwInfo) && (hwHelper.getLocalMemoryAccessMode(*hwInfo) == LocalMemoryAccessMode::CpuAccessAllowed)) { return false; @@ -47,21 +50,21 @@ bool HwInfoConfigHw::getHostMemCapabilitiesSupported(const Hardw } template <> -uint64_t HwInfoConfigHw::getHostMemCapabilitiesValue() { +uint64_t HwInfoConfigHw::getHostMemCapabilitiesValue() { return UNIFIED_SHARED_MEMORY_ACCESS; } template <> -void HwInfoConfigHw::getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) { +void HwInfoConfigHw::getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) { *fp16 = 0u; *fp32 = FP_ATOMIC_EXT_FLAG_GLOBAL_ADD; *fp64 = 0u; } template <> -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { return 2800u; } -template class HwInfoConfigHw; +template class HwInfoConfigHw; } // namespace NEO diff --git a/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl b/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl index 0160d7d6c4..d477f75ec5 100644 --- a/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl +++ b/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl @@ -8,14 +8,7 @@ using namespace NEO; template <> -bool HwInfoConfigHw::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const { - const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); - uint32_t stepping = hwInfoConfig.getSteppingFromHwRevId(hwInfo); - return REVISION_B > stepping; -} - -template <> -uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { +uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { switch (stepping) { case REVISION_A0: return 0x0; @@ -28,7 +21,7 @@ uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t steppin } template <> -uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { +uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { case 0x0: return REVISION_A0; @@ -41,7 +34,13 @@ uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareIn } template <> -void HwInfoConfigHw::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) { +bool HwInfoConfigHw::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const { + uint32_t stepping = getSteppingFromHwRevId(hwInfo); + return REVISION_B > stepping; +} + +template <> +void HwInfoConfigHw::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) { using SAMPLER_STATE = typename XeHpFamily::SAMPLER_STATE; auto samplerState = reinterpret_cast(sampler); @@ -51,6 +50,11 @@ void HwInfoConfigHw::adjustSamplerState(void *sampler, const Har } template <> -std::string HwInfoConfigHw::getDeviceMemoryName() const { +std::string HwInfoConfigHw::getDeviceMemoryName() const { return "HBM"; } + +template <> +bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { + return getSteppingFromHwRevId(hwInfo) >= REVISION_B; +} diff --git a/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp b/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp index f350a6b5ac..ad9ce8a7bb 100644 --- a/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/windows/hw_info_config_xe_hp_sdv.cpp @@ -12,12 +12,14 @@ #include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/hw_info_config.inl" #include "shared/source/os_interface/hw_info_config_xehp_and_later.inl" -#include "shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl" namespace NEO { +constexpr static auto gfxProduct = IGFX_XE_HP_SDV; + +#include "shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl" template <> -int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { +int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) { auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); if (hwHelper.allowRenderCompression(*hwInfo)) { @@ -34,7 +36,7 @@ int HwInfoConfigHw::configureHardwareCustom(HardwareInfo *hwInfo } template <> -bool HwInfoConfigHw::getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) { +bool HwInfoConfigHw::getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) { HwHelper &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily); if (hwHelper.isWorkaroundRequired(REVISION_A0, REVISION_B, *hwInfo) && (hwHelper.getLocalMemoryAccessMode(*hwInfo) == LocalMemoryAccessMode::CpuAccessAllowed)) { return false; @@ -44,17 +46,16 @@ bool HwInfoConfigHw::getHostMemCapabilitiesSupported(const Hardw } template <> -void HwInfoConfigHw::getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) { +void HwInfoConfigHw::getKernelExtendedProperties(uint32_t *fp16, uint32_t *fp32, uint32_t *fp64) { *fp16 = 0u; *fp32 = FP_ATOMIC_EXT_FLAG_GLOBAL_ADD; *fp64 = 0u; } template <> -uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { +uint32_t HwInfoConfigHw::getDeviceMemoryMaxClkRate(const HardwareInfo *hwInfo) { return 2800u; } -template class HwInfoConfigHw; - +template class HwInfoConfigHw; } // namespace NEO diff --git a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp index c520fd7c63..a124e9cae4 100644 --- a/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp +++ b/shared/test/unit_test/encoders/test_encode_dispatch_kernel_xehp_and_later.cpp @@ -570,7 +570,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenInterfaceDescriptorDa iddArg = FamilyType::cmdInitInterfaceDescriptorData; const uint32_t forceThreadGroupDispatchSize = -1; auto hwInfo = pDevice->getHardwareInfo(); - auto &hwHelper = HwHelper::get(renderCoreFamily); const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); DebugManagerStateRestore restorer; @@ -581,7 +580,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenInterfaceDescriptorDa hwInfo.platform.usRevId = hwInfoConfig.getHwRevIdFromStepping(revision, hwInfo); EncodeDispatchKernel::adjustInterfaceDescriptorData(iddArg, hwInfo); - if (hwHelper.isDisableOverdispatchAvailable(hwInfo)) { + if (hwInfoConfig.isDisableOverdispatchAvailable(hwInfo)) { EXPECT_EQ(3u, iddArg.getThreadGroupDispatchSize()); } else { EXPECT_EQ(0u, iddArg.getThreadGroupDispatchSize()); diff --git a/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp b/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp index 5fa54414cd..1eaeb2e511 100644 --- a/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp +++ b/shared/test/unit_test/os_interface/os_agnostic_hw_info_config_tests.cpp @@ -136,6 +136,11 @@ bool HwInfoConfigHw::isDefaultEngineTypeAdjustmentRequired(const H return false; } +template <> +bool HwInfoConfigHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { + return false; +} + void OsAgnosticHwInfoConfigTest::SetUp() { DeviceFixture::SetUp(); } @@ -173,3 +178,8 @@ HWTEST_F(OsAgnosticHwInfoConfigTest, givenHardwareInfoWhenCallingIsDefaultEngine bool ret = hwConfig.isDefaultEngineTypeAdjustmentRequired(hardwareInfo); EXPECT_FALSE(ret); } + +HWTEST_F(OsAgnosticHwInfoConfigTest, givenHardwareInfoWhenCallingIsDisableOverdispatchAvailableThenFalseIsReturned) { + bool ret = hwConfig.isDisableOverdispatchAvailable(hardwareInfo); + EXPECT_FALSE(ret); +}