diff --git a/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl b/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl index fa5517d227..46f6738da6 100644 --- a/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl +++ b/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl @@ -1,10 +1,12 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/constants.h" + #include "aubstream/product_family.h" namespace NEO { diff --git a/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl b/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl index c8250bdc4e..1c73c487c2 100644 --- a/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl +++ b/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl @@ -1,10 +1,11 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/constants.h" #include "shared/source/helpers/gfx_core_helper.h" #include "aubstream/product_family.h" diff --git a/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl b/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl index a8194a4d4e..65f270b92f 100644 --- a/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl +++ b/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl @@ -1,10 +1,11 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/constants.h" #include "shared/source/helpers/gfx_core_helper.h" #include "aubstream/product_family.h" diff --git a/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl b/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl index 0c83ff5d73..c20886b51a 100644 --- a/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl +++ b/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl @@ -1,15 +1,18 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/constants.h" #include "shared/source/helpers/gfx_core_helper.h" +#include "shared/source/unified_memory/usm_memory_support.h" #include "aubstream/product_family.h" namespace NEO { + template <> uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { switch (stepping) { diff --git a/shared/source/gen12lp/linux/product_helper_adln.cpp b/shared/source/gen12lp/linux/product_helper_adln.cpp index 8dcc92b80b..4090cceec8 100644 --- a/shared/source/gen12lp/linux/product_helper_adln.cpp +++ b/shared/source/gen12lp/linux/product_helper_adln.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_adln.h" #include "shared/source/gen12lp/hw_info_adln.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ALDERLAKE_N; diff --git a/shared/source/gen12lp/linux/product_helper_adlp.cpp b/shared/source/gen12lp/linux/product_helper_adlp.cpp index 37251f76ea..a8c13b45ee 100644 --- a/shared/source/gen12lp/linux/product_helper_adlp.cpp +++ b/shared/source/gen12lp/linux/product_helper_adlp.cpp @@ -8,11 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_adlp.h" #include "shared/source/gen12lp/hw_info_adlp.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/helpers/pipeline_select_args.h" -#include "shared/source/helpers/pipeline_select_helper.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ALDERLAKE_P; diff --git a/shared/source/gen12lp/linux/product_helper_adls.cpp b/shared/source/gen12lp/linux/product_helper_adls.cpp index 356c46af2c..9eadbb466c 100644 --- a/shared/source/gen12lp/linux/product_helper_adls.cpp +++ b/shared/source/gen12lp/linux/product_helper_adls.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_adls.h" #include "shared/source/gen12lp/hw_info_adls.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ALDERLAKE_S; diff --git a/shared/source/gen12lp/linux/product_helper_dg1.cpp b/shared/source/gen12lp/linux/product_helper_dg1.cpp index 4396feaf61..a1ad56843e 100644 --- a/shared/source/gen12lp/linux/product_helper_dg1.cpp +++ b/shared/source/gen12lp/linux/product_helper_dg1.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_dg1.h" #include "shared/source/gen12lp/hw_info_dg1.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_DG1; diff --git a/shared/source/gen12lp/linux/product_helper_rkl.cpp b/shared/source/gen12lp/linux/product_helper_rkl.cpp index ba185f57dc..5decbdc271 100644 --- a/shared/source/gen12lp/linux/product_helper_rkl.cpp +++ b/shared/source/gen12lp/linux/product_helper_rkl.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_rkl.h" #include "shared/source/gen12lp/hw_info_rkl.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ROCKETLAKE; diff --git a/shared/source/gen12lp/linux/product_helper_tgllp.cpp b/shared/source/gen12lp/linux/product_helper_tgllp.cpp index d2b6ceaa90..0ee3763b38 100644 --- a/shared/source/gen12lp/linux/product_helper_tgllp.cpp +++ b/shared/source/gen12lp/linux/product_helper_tgllp.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_tgllp.h" #include "shared/source/gen12lp/hw_info_tgllp.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP; diff --git a/shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl b/shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl index 7d16e38d86..9775293d8b 100644 --- a/shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl +++ b/shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl @@ -5,6 +5,10 @@ * */ +#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_before_xe2.inl" +#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" + namespace NEO { template <> void ProductHelperHw::adjustPlatformForProductFamily(HardwareInfo *hwInfo) { @@ -18,21 +22,28 @@ bool ProductHelperHw::isPageTableManagerSupported(const HardwareInfo } template <> -uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { - return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); +bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { + return false; } template <> -const std::vector ProductHelperHw::getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const { - return {}; +bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { + return false; } template <> -uint32_t ProductHelperHw::getMaxLocalRegionSize(const HardwareInfo &hwInfo) const { - return 0; +bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { + return false; } + template <> -uint32_t ProductHelperHw::getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const { - return 0; +bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { + return false; } + +template <> +bool ProductHelperHw::isBufferPoolAllocatorSupported() const { + return false; +} + } // namespace NEO diff --git a/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl b/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl index a15158ac7c..81c8e7b081 100644 --- a/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl +++ b/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl @@ -1,10 +1,11 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/constants.h" #include "shared/source/helpers/gfx_core_helper.h" #include "aubstream/product_family.h" diff --git a/shared/source/gen12lp/windows/product_helper_adln.cpp b/shared/source/gen12lp/windows/product_helper_adln.cpp index 8dcc92b80b..4090cceec8 100644 --- a/shared/source/gen12lp/windows/product_helper_adln.cpp +++ b/shared/source/gen12lp/windows/product_helper_adln.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_adln.h" #include "shared/source/gen12lp/hw_info_adln.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ALDERLAKE_N; diff --git a/shared/source/gen12lp/windows/product_helper_adlp.cpp b/shared/source/gen12lp/windows/product_helper_adlp.cpp index 61ca947f84..d2d9aca233 100644 --- a/shared/source/gen12lp/windows/product_helper_adlp.cpp +++ b/shared/source/gen12lp/windows/product_helper_adlp.cpp @@ -8,11 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_adlp.h" #include "shared/source/gen12lp/hw_info_adlp.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/helpers/pipeline_select_args.h" -#include "shared/source/helpers/pipeline_select_helper.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ALDERLAKE_P; diff --git a/shared/source/gen12lp/windows/product_helper_adls.cpp b/shared/source/gen12lp/windows/product_helper_adls.cpp index 356c46af2c..9eadbb466c 100644 --- a/shared/source/gen12lp/windows/product_helper_adls.cpp +++ b/shared/source/gen12lp/windows/product_helper_adls.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_adls.h" #include "shared/source/gen12lp/hw_info_adls.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ALDERLAKE_S; diff --git a/shared/source/gen12lp/windows/product_helper_dg1.cpp b/shared/source/gen12lp/windows/product_helper_dg1.cpp index 73a2269efe..6f717a99bc 100644 --- a/shared/source/gen12lp/windows/product_helper_dg1.cpp +++ b/shared/source/gen12lp/windows/product_helper_dg1.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_dg1.h" #include "shared/source/gen12lp/hw_info_dg1.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_DG1; diff --git a/shared/source/gen12lp/windows/product_helper_rkl.cpp b/shared/source/gen12lp/windows/product_helper_rkl.cpp index 9674df1145..6105a72724 100644 --- a/shared/source/gen12lp/windows/product_helper_rkl.cpp +++ b/shared/source/gen12lp/windows/product_helper_rkl.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_rkl.h" #include "shared/source/gen12lp/hw_info_rkl.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_ROCKETLAKE; diff --git a/shared/source/gen12lp/windows/product_helper_tgllp.cpp b/shared/source/gen12lp/windows/product_helper_tgllp.cpp index c21f15ecdb..fe53da4f49 100644 --- a/shared/source/gen12lp/windows/product_helper_tgllp.cpp +++ b/shared/source/gen12lp/windows/product_helper_tgllp.cpp @@ -8,9 +8,7 @@ #include "shared/source/gen12lp/hw_cmds_tgllp.h" #include "shared/source/gen12lp/hw_info_tgllp.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_before_xe_hpg.inl" +#include "shared/source/os_interface/product_helper_hw.h" constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP; diff --git a/shared/source/os_interface/CMakeLists.txt b/shared/source/os_interface/CMakeLists.txt index 0ad818b90f..a1d1d76e74 100644 --- a/shared/source/os_interface/CMakeLists.txt +++ b/shared/source/os_interface/CMakeLists.txt @@ -51,10 +51,6 @@ set(NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/sys_calls_common.h ) -if(SUPPORT_XE_HPC_CORE OR SUPPORT_XE_HPG_CORE) - list(APPEND NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_xe_hpg_and_xe_hpc.inl) -endif() - if(SUPPORT_XE_HPC_CORE OR SUPPORT_XE_HPG_CORE OR SUPPORT_XE2_HPG_CORE OR SUPPORT_XE3_CORE) list(APPEND NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_from_xe_hpg_to_xe3.inl) endif() diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 0e6faa3c97..7c24282479 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -1039,4 +1039,72 @@ bool ProductHelperHw::isTimestampWaitSupportedForQueues(bool heaples return false; } +template +const std::vector ProductHelperHw::getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const { + return {}; +} + +template +uint32_t ProductHelperHw::getMaxLocalRegionSize(const HardwareInfo &hwInfo) const { + return 0; +} + +template +uint32_t ProductHelperHw::getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const { + return 0; +} + +template +uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { + return (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess); +} + +template +uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { + return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); +} + +template +uint32_t ProductHelperHw::getInternalHeapsPreallocated() const { + if (debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get() != -1) { + return debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get(); + } + return 0u; +} + +template +bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { + return true; +} + +template +bool ProductHelperHw::isBufferPoolAllocatorSupported() const { + return true; +} + +template +bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { + return true; +} + +template +bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { + return true; +} + +template +bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { + return false; +} + +template +bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { + return true; +} + +template +bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { + return true; +} + } // namespace NEO diff --git a/shared/source/os_interface/product_helper_before_xe2.inl b/shared/source/os_interface/product_helper_before_xe2.inl new file mode 100644 index 0000000000..566b04deaf --- /dev/null +++ b/shared/source/os_interface/product_helper_before_xe2.inl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/product_helper_hw.h" + +namespace NEO { + +template +void ProductHelperHw::enableCompression(HardwareInfo *hwInfo) const { + hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression; + hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression; +} + +template +bool ProductHelperHw::useGemCreateExtInAllocateMemoryByKMD() const { + return false; +} + +template +bool ProductHelperHw::deferMOCSToPatIndex() const { + return false; +} + +template +bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { + return true; +} + +template +bool ProductHelperHw::isCopyBufferRectSplitSupported() const { + return false; +} + +template +std::optional ProductHelperHw::isCoherentAllocation(uint64_t patIndex) const { + return std::nullopt; +} + +} // namespace NEO diff --git a/shared/source/os_interface/product_helper_before_xe_hpg.inl b/shared/source/os_interface/product_helper_before_xe_hpg.inl index 8cb37cc113..3a1b14d1b3 100644 --- a/shared/source/os_interface/product_helper_before_xe_hpg.inl +++ b/shared/source/os_interface/product_helper_before_xe_hpg.inl @@ -5,26 +5,15 @@ * */ -#include "shared/source/os_interface/product_helper.h" +#include "shared/source/os_interface/product_helper_hw.h" namespace NEO { -template -uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { - return (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess); -} - template uint64_t ProductHelperHw::getCrossDeviceSharedMemCapabilities() const { return 0; } -template -void ProductHelperHw::enableCompression(HardwareInfo *hwInfo) const { - hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression; - hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression; -} - template bool ProductHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { return false; @@ -40,92 +29,24 @@ bool ProductHelperHw::isNewResidencyModelSupported() const { return false; } -template -bool ProductHelperHw::deferMOCSToPatIndex() const { - return false; -} - template bool ProductHelperHw::heapInLocalMem(const HardwareInfo &hwInfo) const { return false; } -template -bool ProductHelperHw::useGemCreateExtInAllocateMemoryByKMD() const { - return false; -} - template void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) const { coherencyFlag = true; } -template -bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { - return true; -} - template bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { return false; } -template -bool ProductHelperHw::isCopyBufferRectSplitSupported() const { - return false; -} - template uint32_t ProductHelperHw::getCommandBuffersPreallocatedPerCommandQueue() const { return 0u; } -template -uint32_t ProductHelperHw::getInternalHeapsPreallocated() const { - if (debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get() != -1) { - return debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get(); - } - return 0u; -} - -template -bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { - return true; -} - -template -bool ProductHelperHw::isBufferPoolAllocatorSupported() const { - return false; -} - -template -bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { - return false; -} - -template -bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { - return false; -} - -template -bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { - return false; -} - -template -bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { - return false; -} - -template -bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { - return false; -} - -template -std::optional ProductHelperHw::isCoherentAllocation(uint64_t patIndex) const { - return std::nullopt; -} - } // namespace NEO diff --git a/shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl b/shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl index f021074d14..c5476a0d06 100644 --- a/shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl +++ b/shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl @@ -5,11 +5,22 @@ * */ -#include "shared/source/os_interface/product_helper.h" +#include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/os_interface/product_helper_hw.h" + namespace NEO { template <> bool ProductHelperHw::isTimestampWaitSupportedForQueues(bool heaplessEnabled) const { return true; } + +template <> +uint32_t ProductHelperHw::getInternalHeapsPreallocated() const { + if (debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get() != -1) { + return debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get(); + } + return 1u; +} + } // namespace NEO diff --git a/shared/source/os_interface/product_helper_xe2_and_later.inl b/shared/source/os_interface/product_helper_xe2_and_later.inl index ec407150b1..bbd80fbcf0 100644 --- a/shared/source/os_interface/product_helper_xe2_and_later.inl +++ b/shared/source/os_interface/product_helper_xe2_and_later.inl @@ -14,78 +14,22 @@ namespace NEO { -template -const std::vector ProductHelperHw::getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const { - return {}; -} - -template -uint32_t ProductHelperHw::getMaxLocalRegionSize(const HardwareInfo &hwInfo) const { - return 0; -} - -template -uint32_t ProductHelperHw::getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const { - return 0; -} - -template -uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { - return (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess); -} - -template -uint64_t ProductHelperHw::getCrossDeviceSharedMemCapabilities() const { - uint64_t capabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess; - - if (getConcurrentAccessMemCapabilitiesSupported(UsmAccessCapabilities::sharedCrossDevice)) { - capabilities |= UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess; - } - - return capabilities; -} - template void ProductHelperHw::enableCompression(HardwareInfo *hwInfo) const { hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrXe2Compression; hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrXe2Compression; } -template -uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { - return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); -} - -template -bool ProductHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { - return true; -} - template bool ProductHelperHw::useGemCreateExtInAllocateMemoryByKMD() const { return true; } -template -bool ProductHelperHw::isBlitterFullySupported(const HardwareInfo &hwInfo) const { - return hwInfo.capabilityTable.blitterOperationsSupported; -} - -template -bool ProductHelperHw::isNewResidencyModelSupported() const { - return true; -} - template bool ProductHelperHw::deferMOCSToPatIndex() const { return true; } -template -bool ProductHelperHw::heapInLocalMem(const HardwareInfo &hwInfo) const { - return true; -} - template bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { return false; @@ -96,54 +40,6 @@ bool ProductHelperHw::isCopyBufferRectSplitSupported() const { return true; } -template -bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { - return true; -} - -template -uint32_t ProductHelperHw::getCommandBuffersPreallocatedPerCommandQueue() const { - return 2u; -} - -template -uint32_t ProductHelperHw::getInternalHeapsPreallocated() const { - if (debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get() != -1) { - return debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get(); - } - return 1u; -} - -template -void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) const { - coherencyFlag = false; -} - -template -bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { - return true; -} - -template -bool ProductHelperHw::isBufferPoolAllocatorSupported() const { - return true; -} - -template -bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { - return true; -} - -template -bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { - return true; -} - -template -bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { - return false; -} - template std::optional ProductHelperHw::isCoherentAllocation(uint64_t patIndex) const { std::array listOfCoherentPatIndexes = {1, 2, 4, 5, 7, 22, 23, 26, 27, 30, 31}; @@ -153,14 +49,4 @@ std::optional ProductHelperHw::isCoherentAllocation(uint64_t p return false; } -template -bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { - return true; -} - -template -bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { - return true; -} - } // namespace NEO diff --git a/shared/source/os_interface/product_helper_xe_hpg_and_later.inl b/shared/source/os_interface/product_helper_xe_hpg_and_later.inl new file mode 100644 index 0000000000..eee23f3b30 --- /dev/null +++ b/shared/source/os_interface/product_helper_xe_hpg_and_later.inl @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/product_helper_hw.h" + +namespace NEO { + +template +uint64_t ProductHelperHw::getCrossDeviceSharedMemCapabilities() const { + uint64_t capabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess; + + if (getConcurrentAccessMemCapabilitiesSupported(UsmAccessCapabilities::sharedCrossDevice)) { + capabilities |= UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess; + } + + return capabilities; +} + +template +bool ProductHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { + return true; +} + +template +bool ProductHelperHw::isBlitterFullySupported(const HardwareInfo &hwInfo) const { + return hwInfo.capabilityTable.blitterOperationsSupported; +} + +template +bool ProductHelperHw::isNewResidencyModelSupported() const { + return true; +} + +template +bool ProductHelperHw::heapInLocalMem(const HardwareInfo &hwInfo) const { + return true; +} + +template +bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { + return true; +} + +template +uint32_t ProductHelperHw::getCommandBuffersPreallocatedPerCommandQueue() const { + return 2u; +} + +template +void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) const { + coherencyFlag = false; +} + +} // namespace NEO diff --git a/shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl b/shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl deleted file mode 100644 index 22f6d0acbf..0000000000 --- a/shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2021-2025 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -namespace NEO { - -template -const std::vector ProductHelperHw::getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const { - return {}; -} - -template -uint32_t ProductHelperHw::getMaxLocalRegionSize(const HardwareInfo &hwInfo) const { - return 0; -} -template -uint32_t ProductHelperHw::getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const { - return 0; -} - -template -uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { - return (UnifiedSharedMemoryFlags::access); -} - -template -uint64_t ProductHelperHw::getCrossDeviceSharedMemCapabilities() const { - uint64_t capabilities = UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess; - - if (getConcurrentAccessMemCapabilitiesSupported(UsmAccessCapabilities::sharedCrossDevice)) { - capabilities |= UnifiedSharedMemoryFlags::concurrentAccess | UnifiedSharedMemoryFlags::concurrentAtomicAccess; - } - - return capabilities; -} - -template -void ProductHelperHw::enableCompression(HardwareInfo *hwInfo) const { - hwInfo->capabilityTable.ftrRenderCompressedImages = hwInfo->featureTable.flags.ftrE2ECompression; - hwInfo->capabilityTable.ftrRenderCompressedBuffers = hwInfo->featureTable.flags.ftrE2ECompression; -} - -template -uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { - if (isMaxThreadsForWorkgroupWARequired(hwInfo)) { - return std::min(getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice), 64u); - } - return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); -} - -template -bool ProductHelperHw::obtainBlitterPreference(const HardwareInfo &hwInfo) const { - return true; -} - -template -bool ProductHelperHw::useGemCreateExtInAllocateMemoryByKMD() const { - return false; -} - -template -bool ProductHelperHw::isBlitterFullySupported(const HardwareInfo &hwInfo) const { - return hwInfo.capabilityTable.blitterOperationsSupported; -} - -template -bool ProductHelperHw::isNewResidencyModelSupported() const { - return true; -} - -template -bool ProductHelperHw::deferMOCSToPatIndex() const { - return false; -} - -template -void ProductHelperHw::setCapabilityCoherencyFlag(const HardwareInfo &hwInfo, bool &coherencyFlag) const { - coherencyFlag = false; -} - -template -bool ProductHelperHw::isInitBuiltinAsyncSupported(const HardwareInfo &hwInfo) const { - return true; -} - -template -bool ProductHelperHw::isCopyBufferRectSplitSupported() const { - return false; -} - -template -bool ProductHelperHw::isTimestampWaitSupportedForEvents() const { - return true; -} - -template -uint32_t ProductHelperHw::getInternalHeapsPreallocated() const { - if (debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get() != -1) { - return debugManager.flags.SetAmountOfInternalHeapsToPreallocate.get(); - } - return 1u; -} - -template -bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { - return false; -} - -template -uint32_t ProductHelperHw::getCommandBuffersPreallocatedPerCommandQueue() const { - return 2u; -} - -template -bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { - return false; -} - -template -bool ProductHelperHw::heapInLocalMem(const HardwareInfo &hwInfo) const { - return true; -} - -} // namespace NEO diff --git a/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl b/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl index cb65df92e4..b502f23cbe 100644 --- a/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl +++ b/shared/source/xe2_hpg_core/bmg/os_agnostic_product_helper_bmg.inl @@ -20,11 +20,6 @@ bool ProductHelperHw::isResolveDependenciesByPipeControlsSupported(c return enabled; } -template <> -bool ProductHelperHw::isBufferPoolAllocatorSupported() const { - return true; -} - template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Bmg; diff --git a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp index e1b8fd7387..230c31d2ff 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp @@ -5,11 +5,8 @@ * */ -#include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_xe2_and_later.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe2_hpg_core/hw_cmds_bmg.h" #include "shared/source/xe2_hpg_core/hw_info_bmg.h" diff --git a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp index 8c9223a327..325d01ea29 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp @@ -5,12 +5,8 @@ * */ -#include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/kernel/kernel_properties.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_xe2_and_later.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe2_hpg_core/hw_cmds_lnl.h" #include "shared/source/xe2_hpg_core/hw_info_lnl.h" diff --git a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl index c395c6d147..a653a14c5a 100644 --- a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl +++ b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl @@ -6,6 +6,8 @@ */ #include "shared/source/command_stream/command_stream_receiver.h" +#include "shared/source/direct_submission/direct_submission_controller.h" +#include "shared/source/memory_manager/allocation_properties.h" #include "aubstream/product_family.h" @@ -93,11 +95,6 @@ TimeoutParams ProductHelperHw::getDirectSubmissionControllerTimeoutP return params; } -template <> -bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { - return true; -} - template <> bool ProductHelperHw::isMisalignedUserPtr2WayCoherent() const { return true; diff --git a/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl b/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl index 44badf8c35..ac01fb68c1 100644 --- a/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl +++ b/shared/source/xe2_hpg_core/os_agnostic_product_helper_xe2_hpg_core.inl @@ -5,8 +5,11 @@ * */ +#include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl" +#include "shared/source/os_interface/product_helper_xe2_and_later.inl" #include "shared/source/os_interface/product_helper_xe_hpc_and_later.inl" +#include "shared/source/os_interface/product_helper_xe_hpg_and_later.inl" namespace NEO { diff --git a/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp b/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp index 13c5ae816e..dbc892448f 100644 --- a/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/windows/product_helper_bmg.cpp @@ -1,13 +1,11 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_xe2_and_later.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe2_hpg_core/hw_cmds_bmg.h" #include "shared/source/xe2_hpg_core/hw_info_bmg.h" diff --git a/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp b/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp index c57c478554..3f6cce1b44 100644 --- a/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/windows/product_helper_lnl.cpp @@ -5,9 +5,7 @@ * */ -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_xe2_and_later.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe2_hpg_core/hw_cmds_lnl.h" #include "shared/source/xe2_hpg_core/hw_info_lnl.h" diff --git a/shared/source/xe3_core/linux/product_helper_ptl.cpp b/shared/source/xe3_core/linux/product_helper_ptl.cpp index 7b3badd5ce..e0ffb50e18 100644 --- a/shared/source/xe3_core/linux/product_helper_ptl.cpp +++ b/shared/source/xe3_core/linux/product_helper_ptl.cpp @@ -5,12 +5,8 @@ * */ -#include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/kernel/kernel_properties.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_xe2_and_later.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe3_core/hw_cmds_ptl.h" #include "shared/source/xe3_core/hw_info_ptl.h" diff --git a/shared/source/xe3_core/os_agnostic_product_helper_xe3_core.inl b/shared/source/xe3_core/os_agnostic_product_helper_xe3_core.inl index 873e727c12..4822f0f551 100644 --- a/shared/source/xe3_core/os_agnostic_product_helper_xe3_core.inl +++ b/shared/source/xe3_core/os_agnostic_product_helper_xe3_core.inl @@ -5,8 +5,11 @@ * */ +#include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl" +#include "shared/source/os_interface/product_helper_xe2_and_later.inl" #include "shared/source/os_interface/product_helper_xe_hpc_and_later.inl" +#include "shared/source/os_interface/product_helper_xe_hpg_and_later.inl" namespace NEO { diff --git a/shared/source/xe3_core/windows/product_helper_ptl.cpp b/shared/source/xe3_core/windows/product_helper_ptl.cpp index 23e46f80ec..9b21b4487c 100644 --- a/shared/source/xe3_core/windows/product_helper_ptl.cpp +++ b/shared/source/xe3_core/windows/product_helper_ptl.cpp @@ -6,9 +6,7 @@ */ #include "shared/source/command_stream/command_stream_receiver.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_xe2_and_later.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe3_core/hw_cmds_ptl.h" #include "shared/source/xe3_core/hw_info_ptl.h" diff --git a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp index 8665f91c36..e0745c0398 100644 --- a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -14,8 +14,7 @@ #include "shared/source/os_interface/linux/pci_path.h" #include "shared/source/os_interface/linux/pmt_util.h" #include "shared/source/os_interface/linux/sys_calls.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/utilities/directory.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" diff --git a/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl b/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl index c5e37b73fd..4da399a220 100644 --- a/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl +++ b/shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl @@ -55,17 +55,17 @@ bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { return false; } -template +template <> bool ProductHelperHw::isBufferPoolAllocatorSupported() const { return false; } -template +template <> bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { return false; } -template +template <> bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { return false; } diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl index 8fd51f9f0f..b1c796acd7 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl @@ -8,7 +8,9 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/definitions/indirect_detection_versions.h" #include "shared/source/helpers/string_helpers.h" -#include "shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl" +#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_before_xe2.inl" +#include "shared/source/os_interface/product_helper_xe_hpg_and_later.inl" #include "aubstream/product_family.h" @@ -253,14 +255,27 @@ bool ProductHelperHw::supportReadOnlyAllocations() const { return true; } -template <> -std::optional ProductHelperHw::isCoherentAllocation(uint64_t patIndex) const { - return std::nullopt; -} - template <> bool ProductHelperHw::isSharingWith3dOrMediaAllowed() const { return false; } +template <> +uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { + return (UnifiedSharedMemoryFlags::access); +} + +template <> +bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { + return false; +} + +template <> +uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { + if (isMaxThreadsForWorkgroupWARequired(hwInfo)) { + return std::min(getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice), 64u); + } + return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); +} + } // namespace NEO diff --git a/shared/source/xe_hpc_core/windows/product_helper_pvc.cpp b/shared/source/xe_hpc_core/windows/product_helper_pvc.cpp index d5675b6724..7109c3b51b 100644 --- a/shared/source/xe_hpc_core/windows/product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/windows/product_helper_pvc.cpp @@ -1,13 +1,12 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/kernel/kernel_properties.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" constexpr static auto gfxProduct = IGFX_PVC; diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl index 22ad731fdd..62a7d90283 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl @@ -7,9 +7,9 @@ #include "shared/source/command_stream/command_stream_receiver.h" #include "shared/source/helpers/gfx_core_helper.h" +#include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/memory_manager/memory_manager.h" -#include "shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl" -#include "shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl" +#include "shared/source/unified_memory/usm_memory_support.h" #include "aubstream/product_family.h" @@ -200,21 +200,6 @@ bool ProductHelperHw::isResolveDependenciesByPipeControlsSupported(c return enabled; } -template <> -bool ProductHelperHw::isBufferPoolAllocatorSupported() const { - return true; -} - -template <> -bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { - return true; -} - -template <> -bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { - return true; -} - template <> bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { return true; @@ -257,19 +242,14 @@ void ProductHelperHw::adjustNumberOfCcs(HardwareInfo &hwInfo) const hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1; } -template <> -std::optional ProductHelperHw::isCoherentAllocation(uint64_t patIndex) const { - return std::nullopt; -} - template <> bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { return false; } template <> -bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { - return true; +uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { + return (UnifiedSharedMemoryFlags::access); } } // namespace NEO diff --git a/shared/source/xe_hpg_core/linux/product_helper_arl.cpp b/shared/source/xe_hpg_core/linux/product_helper_arl.cpp index da6bac209d..93058e0e84 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_arl.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_arl.cpp @@ -1,14 +1,16 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpg_core/hw_cmds_arl.h" constexpr static auto gfxProduct = IGFX_ARROWLAKE; +#include "shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl" #include "shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl" #include "shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl" diff --git a/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp b/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp index da999791ea..52b9923022 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp @@ -5,22 +5,17 @@ * */ -#include "shared/source/command_stream/stream_properties.h" -#include "shared/source/debug_settings/debug_settings_manager.h" -#include "shared/source/device/device.h" -#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/driver_model_type.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/helpers/string.h" -#include "shared/source/kernel/kernel_properties.h" #include "shared/source/os_interface/linux/drm_neo.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/os_interface.h" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" constexpr static auto gfxProduct = IGFX_DG2; #include "shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl" +#include "shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl" namespace NEO { diff --git a/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp b/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp index 6f86c1a8ad..11e2621c34 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp @@ -1,14 +1,16 @@ /* - * Copyright (C) 2022-2024 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" constexpr static auto gfxProduct = IGFX_METEORLAKE; +#include "shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl" #include "shared/source/xe_hpg_core/xe_lpg/linux/product_helper_xe_lpg_linux.inl" #include "shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl" namespace NEO { diff --git a/shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl b/shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl new file mode 100644 index 0000000000..65a2937593 --- /dev/null +++ b/shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_before_xe2.inl" +#include "shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl" +#include "shared/source/os_interface/product_helper_xe_hpg_and_later.inl" + +namespace NEO { + +template <> +uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { + if (isMaxThreadsForWorkgroupWARequired(hwInfo)) { + return std::min(getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice), 64u); + } + return getMaxThreadsForWorkgroup(hwInfo, maxNumEUsPerDualSubSlice); +} + +} // namespace NEO diff --git a/shared/source/xe_hpg_core/windows/product_helper_arl.cpp b/shared/source/xe_hpg_core/windows/product_helper_arl.cpp index 5357ba58af..a31030054d 100644 --- a/shared/source/xe_hpg_core/windows/product_helper_arl.cpp +++ b/shared/source/xe_hpg_core/windows/product_helper_arl.cpp @@ -1,14 +1,16 @@ /* - * Copyright (C) 2023 Intel Corporation + * Copyright (C) 2023-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpg_core/hw_cmds_arl.h" constexpr static auto gfxProduct = IGFX_ARROWLAKE; +#include "shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl" #include "shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl" #include "shared/source/xe_hpg_core/xe_lpg/windows/product_helper_xe_lpg_windows.inl" diff --git a/shared/source/xe_hpg_core/windows/product_helper_dg2.cpp b/shared/source/xe_hpg_core/windows/product_helper_dg2.cpp index bd4122845b..1138ccebd9 100644 --- a/shared/source/xe_hpg_core/windows/product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/windows/product_helper_dg2.cpp @@ -1,21 +1,18 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "shared/source/command_stream/stream_properties.h" -#include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/kernel/kernel_properties.h" -#include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" constexpr static auto gfxProduct = IGFX_DG2; #include "shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl" +#include "shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl" #include "windows_product_helper_dg2_extra.inl" diff --git a/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp b/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp index b013f42e70..3beae7b2e0 100644 --- a/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp @@ -1,14 +1,16 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/os_interface/product_helper_hw.h" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" constexpr static auto gfxProduct = IGFX_METEORLAKE; +#include "shared/source/xe_hpg_core/os_agnostic_product_helper_xe_hpg_core.inl" #include "shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl" #include "shared/source/xe_hpg_core/xe_lpg/windows/product_helper_xe_lpg_windows.inl" diff --git a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl index a9a8db6923..81766911f7 100644 --- a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl +++ b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl @@ -10,20 +10,12 @@ #include "shared/source/memory_manager/allocation_properties.h" #include "shared/source/memory_manager/allocation_type.h" #include "shared/source/os_interface/product_helper.h" -#include "shared/source/os_interface/product_helper.inl" -#include "shared/source/os_interface/product_helper_from_xe_hpg_to_xe3.inl" -#include "shared/source/os_interface/product_helper_xe_hpg_and_xe_hpc.inl" #include "aubstream/product_family.h" #include "platforms.h" namespace NEO { -template <> -uint64_t ProductHelperHw::getHostMemCapabilitiesValue() const { - return (UnifiedSharedMemoryFlags::access | UnifiedSharedMemoryFlags::atomicAccess); -} - template <> bool ProductHelperHw::isPageTableManagerSupported(const HardwareInfo &hwInfo) const { return hwInfo.capabilityTable.ftrRenderCompressedBuffers || hwInfo.capabilityTable.ftrRenderCompressedImages; @@ -58,31 +50,11 @@ bool ProductHelperHw::isResolveDependenciesByPipeControlsSupported(c return enabled; } -template <> -bool ProductHelperHw::isBufferPoolAllocatorSupported() const { - return true; -} - -template <> -bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { - return true; -} - -template <> -bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { - return true; -} - template <> bool ProductHelperHw::overrideAllocationCacheable(const AllocationData &allocationData) const { return allocationData.type == AllocationType::commandBuffer; } -template <> -uint32_t ProductHelperHw::getCommandBuffersPreallocatedPerCommandQueue() const { - return 2u; -} - template <> std::optional ProductHelperHw::getPreferredAllocationMethod(AllocationType allocationType) const { switch (allocationType) { @@ -114,12 +86,8 @@ std::optional ProductHelperHw::isCoherentAllocation(uint64_t p } template <> -bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { - return true; +bool ProductHelperHw::isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const { + return false; } -template <> -bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { - return true; -} } // namespace NEO diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index fe355b3b1b..2a452f8ce3 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -21,20 +21,6 @@ template <> void ProductHelperHw::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const { } -template <> -const std::vector ProductHelperHw::getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const { - return {}; -} -template <> -uint32_t ProductHelperHw::getMaxLocalRegionSize(const HardwareInfo &hwInfo) const { - return 0; -} - -template <> -uint32_t ProductHelperHw::getMaxLocalSubRegionSize(const HardwareInfo &hwInfo) const { - return 0; -} - template <> uint32_t ProductHelperHw::getMaxThreadsForWorkgroupInDSSOrSS(const HardwareInfo &hwInfo, uint32_t maxNumEUsPerSubSlice, uint32_t maxNumEUsPerDualSubSlice) const { return 0; @@ -432,33 +418,33 @@ std::vector ProductHelperHw::getSupportedNumGrfs(const R return {}; } -template -bool ProductHelperHw::isBufferPoolAllocatorSupported() const { +template <> +bool ProductHelperHw::isBufferPoolAllocatorSupported() const { return false; } -template -bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { +template <> +bool ProductHelperHw::isHostUsmPoolAllocatorSupported() const { return false; } -template -bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { +template <> +bool ProductHelperHw::isDeviceUsmPoolAllocatorSupported() const { return false; } -template -bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { +template <> +bool ProductHelperHw::isDeviceUsmAllocationReuseSupported() const { return false; } -template -bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { +template <> +bool ProductHelperHw::isHostUsmAllocationReuseSupported() const { return false; } -template -bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { +template <> +bool ProductHelperHw::useLocalPreferredForCacheableBuffers() const { return false; }