diff --git a/level_zero/core/source/device/device.h b/level_zero/core/source/device/device.h index 0552245f9b..73ca511cc0 100644 --- a/level_zero/core/source/device/device.h +++ b/level_zero/core/source/device/device.h @@ -96,6 +96,7 @@ struct Device : _ze_device_handle_t { virtual const NEO::GfxCoreHelper &getGfxCoreHelper() = 0; virtual const L0GfxCoreHelper &getL0GfxCoreHelper() = 0; virtual const NEO::ProductHelper &getProductHelper() = 0; + virtual const NEO::CompilerProductHelper &getCompilerProductHelper() = 0; bool isImplicitScalingCapable() const { return implicitScalingCapable; diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 67ee1e03a2..3a0a8c16ae 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -867,8 +867,8 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties) } else if (extendedProperties->stype == ZE_STRUCTURE_TYPE_DEVICE_IP_VERSION_EXT) { ze_device_ip_version_ext_t *zeDeviceIpVersion = reinterpret_cast(extendedProperties); NEO::Device *activeDevice = getActiveDevice(); - auto &productHelper = activeDevice->getProductHelper(); - zeDeviceIpVersion->ipVersion = productHelper.getHwIpVersion(hardwareInfo); + auto &compilerProductHelper = activeDevice->getCompilerProductHelper(); + zeDeviceIpVersion->ipVersion = compilerProductHelper.getHwIpVersion(hardwareInfo); } extendedProperties = static_cast(extendedProperties->pNext); } @@ -1079,6 +1079,10 @@ const NEO::ProductHelper &DeviceImp::getProductHelper() { return this->neoDevice->getProductHelper(); } +const NEO::CompilerProductHelper &DeviceImp::getCompilerProductHelper() { + return this->neoDevice->getCompilerProductHelper(); +} + NEO::OSInterface &DeviceImp::getOsInterface() { return *neoDevice->getRootDeviceEnvironment().osInterface; } uint32_t DeviceImp::getPlatformInfo() const { diff --git a/level_zero/core/source/device/device_imp.h b/level_zero/core/source/device/device_imp.h index 1de19e721c..0a85f036aa 100644 --- a/level_zero/core/source/device/device_imp.h +++ b/level_zero/core/source/device/device_imp.h @@ -74,6 +74,7 @@ struct DeviceImp : public Device { const NEO::GfxCoreHelper &getGfxCoreHelper() override; const L0GfxCoreHelper &getL0GfxCoreHelper() override; const NEO::ProductHelper &getProductHelper() override; + const NEO::CompilerProductHelper &getCompilerProductHelper() override; const NEO::HardwareInfo &getHwInfo() const override; NEO::OSInterface &getOsInterface() override; uint32_t getPlatformInfo() const override; diff --git a/level_zero/core/test/unit_tests/mocks/mock_device.h b/level_zero/core/test/unit_tests/mocks/mock_device.h index 61ccd9c1e7..aa7f261b37 100644 --- a/level_zero/core/test/unit_tests/mocks/mock_device.h +++ b/level_zero/core/test/unit_tests/mocks/mock_device.h @@ -60,6 +60,7 @@ struct Mock : public Device { ADDMETHOD_NOBASE_REFRETURN(getGfxCoreHelper, NEO::GfxCoreHelper &, ()); ADDMETHOD_NOBASE_REFRETURN(getL0GfxCoreHelper, L0GfxCoreHelper &, ()); ADDMETHOD_NOBASE_REFRETURN(getProductHelper, NEO::ProductHelper &, ()); + ADDMETHOD_NOBASE_REFRETURN(getCompilerProductHelper, NEO::CompilerProductHelper &, ()); ADDMETHOD_NOBASE(getBuiltinFunctionsLib, BuiltinFunctionsLib *, nullptr, ()); ADDMETHOD_CONST_NOBASE(getMaxNumHwThreads, uint32_t, 16u, ()); ADDMETHOD_NOBASE(activateMetricGroupsDeferred, ze_result_t, ZE_RESULT_SUCCESS, (uint32_t count, zet_metric_group_handle_t *phMetricGroups)); diff --git a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp index 2379d07edc..04f1fb1d3f 100644 --- a/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp +++ b/level_zero/core/test/unit_tests/sources/device/test_l0_device.cpp @@ -1254,8 +1254,8 @@ TEST_F(DeviceTest, givenDeviceIpVersionWhenGetDevicePropertiesThenCorrectResultI zeDeviceIpVersion.ipVersion = std::numeric_limits::max(); deviceProperties.pNext = &zeDeviceIpVersion; - auto &productHelper = device->getProductHelper(); - auto expectedIpVersion = productHelper.getHwIpVersion(device->getHwInfo()); + auto &compilerProductHelper = device->getCompilerProductHelper(); + auto expectedIpVersion = compilerProductHelper.getHwIpVersion(device->getHwInfo()); device->getProperties(&deviceProperties); EXPECT_NE(std::numeric_limits::max(), zeDeviceIpVersion.ipVersion); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index 96559bd033..c7f5cb717f 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -2290,10 +2290,10 @@ HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpRequir HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpPackedTargetDeviceBinary) { PatchTokensTestData::ValidEmptyProgram programTokens; - auto &productHelper = device->getProductHelper(); + auto &compilerProductHelper = device->getCompilerProductHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); NEO::Ar::ArEncoder encoder; std::string requiredProduct = NEO::hardwarePrefix[productFamily]; @@ -2308,7 +2308,7 @@ HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpPacked NEO::TargetDevice target; target.coreFamily = static_cast(programTokens.header->Device); - target.aotConfig.value = productHelper.getHwIpVersion(hwInfo); + target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); target.stepping = programTokens.header->SteppingId; target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes; diff --git a/opencl/source/cl_device/cl_device.cpp b/opencl/source/cl_device/cl_device.cpp index d06ad7d24d..796c543abe 100644 --- a/opencl/source/cl_device/cl_device.cpp +++ b/opencl/source/cl_device/cl_device.cpp @@ -284,6 +284,10 @@ const ProductHelper &ClDevice::getProductHelper() const { return device.getProductHelper(); } +const CompilerProductHelper &ClDevice::getCompilerProductHelper() const { + return device.getCompilerProductHelper(); +} + const GTPinGfxCoreHelper &ClDevice::getGTPinGfxCoreHelper() const { return *gtpinGfxCoreHelper; } diff --git a/opencl/source/cl_device/cl_device.h b/opencl/source/cl_device/cl_device.h index 24252a78f4..ced3af7dea 100644 --- a/opencl/source/cl_device/cl_device.h +++ b/opencl/source/cl_device/cl_device.h @@ -133,6 +133,7 @@ class ClDevice : public BaseObject<_cl_device_id> { Platform *getPlatform() const; const GfxCoreHelper &getGfxCoreHelper() const; const ProductHelper &getProductHelper() const; + const CompilerProductHelper &getCompilerProductHelper() const; const GTPinGfxCoreHelper &getGTPinGfxCoreHelper() const; std::unique_ptr gtpinGfxCoreHelper; diff --git a/opencl/source/cl_device/cl_device_info.cpp b/opencl/source/cl_device/cl_device_info.cpp index 8abcc3605b..f42a2db1a2 100644 --- a/opencl/source/cl_device/cl_device_info.cpp +++ b/opencl/source/cl_device/cl_device_info.cpp @@ -11,6 +11,7 @@ #include "shared/source/device/device.h" #include "shared/source/device/device_info.h" #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/get_info.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" @@ -259,8 +260,8 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName, auto &clGfxCoreHelper = this->getRootDeviceEnvironment().getHelper(); param.uint = clGfxCoreHelper.getDeviceIpVersion(getHardwareInfo()); } else { - auto &productHelper = device.getProductHelper(); - param.uint = static_cast(productHelper.getHwIpVersion(getHardwareInfo())); + auto &compilerProductHelper = device.getCompilerProductHelper(); + param.uint = static_cast(compilerProductHelper.getHwIpVersion(getHardwareInfo())); } src = ¶m.uint; retSize = srcSize = sizeof(cl_version); diff --git a/opencl/test/unit_test/device/get_device_info_tests.cpp b/opencl/test/unit_test/device/get_device_info_tests.cpp index f5212261e3..90a4d8f8e8 100644 --- a/opencl/test/unit_test/device/get_device_info_tests.cpp +++ b/opencl/test/unit_test/device/get_device_info_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/get_info.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/raii_gfx_core_helper.h" @@ -1119,8 +1120,8 @@ struct DeviceAttributeQueryTest : public ::testing::TestWithParam(); EXPECT_EQ(clGfxCoreHelper.getDeviceIpVersion(hwInfo), *pDeviceIpVersion); } else { - auto &productHelper = device.getProductHelper(); - EXPECT_EQ(static_cast(productHelper.getHwIpVersion(hwInfo)), *pDeviceIpVersion); + auto &compilerProductHelper = device.getCompilerProductHelper(); + EXPECT_EQ(static_cast(compilerProductHelper.getHwIpVersion(hwInfo)), *pDeviceIpVersion); } EXPECT_EQ(sizeof(cl_version), sizeReturned); break; diff --git a/shared/source/device_binary_format/device_binary_formats.cpp b/shared/source/device_binary_format/device_binary_formats.cpp index 26848c0373..9daf3976a2 100644 --- a/shared/source/device_binary_format/device_binary_formats.cpp +++ b/shared/source/device_binary_format/device_binary_formats.cpp @@ -11,7 +11,6 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" namespace NEO { @@ -24,13 +23,13 @@ std::vector packDeviceBinary(const SingleDeviceBinary binary, std::stri TargetDevice getTargetDevice(const RootDeviceEnvironment &rootDeviceEnvironment) { auto hwInfo = *rootDeviceEnvironment.getHardwareInfo(); - auto &productHelper = rootDeviceEnvironment.getHelper(); + auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); TargetDevice targetDevice = {}; targetDevice.coreFamily = hwInfo.platform.eRenderCoreFamily; targetDevice.productFamily = hwInfo.platform.eProductFamily; - targetDevice.aotConfig.value = productHelper.getHwIpVersion(hwInfo); + targetDevice.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); targetDevice.stepping = hwInfo.platform.usRevId; targetDevice.maxPointerSizeInBytes = sizeof(uintptr_t); targetDevice.grfSize = hwInfo.capabilityTable.grfSize; diff --git a/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl b/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl deleted file mode 100644 index cf0d9798be..0000000000 --- a/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::EHL; -} -} // namespace NEO diff --git a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp index c6b7e9150b..94a4663f5d 100644 --- a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp @@ -15,12 +15,19 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100040008; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::EHL; +} + static EnableCompilerProductHelper enableCompilerProductHelperEHL; } // namespace NEO diff --git a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp index 4245e468d0..3c25677af2 100644 --- a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp @@ -15,12 +15,19 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100080008; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::ICL; +} + static EnableCompilerProductHelper enableCompilerProductHelperICLLP; } // namespace NEO diff --git a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp index 093eddf7cb..4afbb83190 100644 --- a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp @@ -15,12 +15,19 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100080008; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::LKF; +} + static EnableCompilerProductHelper enableCompilerProductHelperLKF; } // namespace NEO diff --git a/shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl b/shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl index 22c6d89b97..7689bd6156 100644 --- a/shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl +++ b/shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl @@ -23,11 +23,6 @@ bool ProductHelperHw::isReturnedCmdSizeForMediaSamplerAdjustmentRequ return true; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::ICL; -} - template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Icllp; diff --git a/shared/source/gen11/linux/product_helper_ehl.cpp b/shared/source/gen11/linux/product_helper_ehl.cpp index f520ef6ef8..39391581a3 100644 --- a/shared/source/gen11/linux/product_helper_ehl.cpp +++ b/shared/source/gen11/linux/product_helper_ehl.cpp @@ -11,11 +11,8 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ELKHARTLAKE; -#include "shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl" namespace NEO { template <> diff --git a/shared/source/gen11/linux/product_helper_icllp.cpp b/shared/source/gen11/linux/product_helper_icllp.cpp index f110835b03..82f154baa4 100644 --- a/shared/source/gen11/linux/product_helper_icllp.cpp +++ b/shared/source/gen11/linux/product_helper_icllp.cpp @@ -11,8 +11,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ICELAKE_LP; #include "shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl" namespace NEO { diff --git a/shared/source/gen11/linux/product_helper_lkf.cpp b/shared/source/gen11/linux/product_helper_lkf.cpp index 09428a7538..c12e994e7d 100644 --- a/shared/source/gen11/linux/product_helper_lkf.cpp +++ b/shared/source/gen11/linux/product_helper_lkf.cpp @@ -11,10 +11,7 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_LAKEFIELD; -#include "shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl" namespace NEO { template <> diff --git a/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl b/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl deleted file mode 100644 index 68de0dec0e..0000000000 --- a/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::LKF; -} -} // namespace NEO diff --git a/shared/source/gen11/windows/product_helper_ehl.cpp b/shared/source/gen11/windows/product_helper_ehl.cpp index ca967e9f0a..256fcf842c 100644 --- a/shared/source/gen11/windows/product_helper_ehl.cpp +++ b/shared/source/gen11/windows/product_helper_ehl.cpp @@ -10,10 +10,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ELKHARTLAKE; -#include "shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl" - template class NEO::ProductHelperHw; diff --git a/shared/source/gen11/windows/product_helper_icllp.cpp b/shared/source/gen11/windows/product_helper_icllp.cpp index 01855061a6..986df603f6 100644 --- a/shared/source/gen11/windows/product_helper_icllp.cpp +++ b/shared/source/gen11/windows/product_helper_icllp.cpp @@ -10,8 +10,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ICELAKE_LP; #include "shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl" diff --git a/shared/source/gen11/windows/product_helper_lkf.cpp b/shared/source/gen11/windows/product_helper_lkf.cpp index 3851741d82..697600c798 100644 --- a/shared/source/gen11/windows/product_helper_lkf.cpp +++ b/shared/source/gen11/windows/product_helper_lkf.cpp @@ -10,10 +10,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_LAKEFIELD; -#include "shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl" - template class NEO::ProductHelperHw; 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 988b93f7fe..fa5517d227 100644 --- a/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl +++ b/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl @@ -17,11 +17,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::ADL_N; -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { 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 32fd777393..c8250bdc4e 100644 --- a/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl +++ b/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl @@ -21,11 +21,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::ADL_P; -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { 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 05f78d86f3..a8194a4d4e 100644 --- a/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl +++ b/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl @@ -22,9 +22,9 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::ADL_S; -} +std::optional ProductHelperHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Adls; +}; template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { @@ -37,11 +37,6 @@ uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo return CommonConstants::invalidStepping; } -template <> -std::optional ProductHelperHw::getAubStreamProductFamily() const { - return aub_stream::ProductFamily::Adls; -}; - template <> bool ProductHelperHw::pipeControlWARequired(const HardwareInfo &hwInfo) const { return GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this); diff --git a/shared/source/gen12lp/compiler_product_helper_rkl.inl b/shared/source/gen12lp/compiler_product_helper_rkl.inl deleted file mode 100644 index 80123bd339..0000000000 --- a/shared/source/gen12lp/compiler_product_helper_rkl.inl +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -template <> -uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { - return 0x100020010; -} -template <> -bool CompilerProductHelperHw::isForceEmuInt32DivRemSPRequired() const { - return true; -} 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 aa55426a2e..fd57a62ee4 100644 --- a/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl +++ b/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl @@ -21,11 +21,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::DG1; -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp index 1ff0e38563..ba1e37adf6 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp @@ -16,9 +16,15 @@ #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "compiler_product_helper_adln.inl" +#include "platforms.h" namespace NEO { +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::ADL_N; +} + static EnableCompilerProductHelper enableCompilerProductHelperADLN; } // namespace NEO diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp index e952624787..bd94a9a3b2 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp @@ -16,9 +16,15 @@ #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "compiler_product_helper_adlp.inl" +#include "platforms.h" namespace NEO { +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::ADL_P; +} + static EnableCompilerProductHelper enableCompilerProductHelperADLP; } // namespace NEO diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp index 97b380e747..5e843373fa 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp @@ -15,12 +15,19 @@ #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100020010; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::ADL_S; +} + static EnableCompilerProductHelper enableCompilerProductHelperADLS; } // namespace NEO diff --git a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp index a7902510b6..c980739040 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp @@ -15,12 +15,19 @@ #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100060010; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::DG1; +} + static EnableCompilerProductHelper enableCompilerProductHelperDG1; } // namespace NEO diff --git a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp index 51a912cbec..06e14dfdcb 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp @@ -15,9 +15,24 @@ #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" +#include "platforms.h" + namespace NEO { -#include "shared/source/gen12lp/compiler_product_helper_rkl.inl" +template <> +uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { + return 0x100020010; +} +template <> +bool CompilerProductHelperHw::isForceEmuInt32DivRemSPRequired() const { + return true; +} + +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::RKL; +} + static EnableCompilerProductHelper enableCompilerProductHelperRKL; } // namespace NEO diff --git a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp index 1c36e7db65..fb1b3f20b8 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp @@ -15,12 +15,19 @@ #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100060010; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::TGL; +} + static EnableCompilerProductHelper enableCompilerProductHelperTGLLP; } // namespace NEO diff --git a/shared/source/gen12lp/linux/product_helper_adln.cpp b/shared/source/gen12lp/linux/product_helper_adln.cpp index a5d642f5a7..5a6b0aac7d 100644 --- a/shared/source/gen12lp/linux/product_helper_adln.cpp +++ b/shared/source/gen12lp/linux/product_helper_adln.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ALDERLAKE_N; #include "shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl" diff --git a/shared/source/gen12lp/linux/product_helper_adlp.cpp b/shared/source/gen12lp/linux/product_helper_adlp.cpp index 337ec28342..b0782b1269 100644 --- a/shared/source/gen12lp/linux/product_helper_adlp.cpp +++ b/shared/source/gen12lp/linux/product_helper_adlp.cpp @@ -14,8 +14,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ALDERLAKE_P; #include "shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl" diff --git a/shared/source/gen12lp/linux/product_helper_adls.cpp b/shared/source/gen12lp/linux/product_helper_adls.cpp index a5ed5ef9a4..c5ef2efd36 100644 --- a/shared/source/gen12lp/linux/product_helper_adls.cpp +++ b/shared/source/gen12lp/linux/product_helper_adls.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ALDERLAKE_S; #include "shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl" diff --git a/shared/source/gen12lp/linux/product_helper_dg1.cpp b/shared/source/gen12lp/linux/product_helper_dg1.cpp index a5174e0645..5c65f26593 100644 --- a/shared/source/gen12lp/linux/product_helper_dg1.cpp +++ b/shared/source/gen12lp/linux/product_helper_dg1.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_DG1; #include "shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl" diff --git a/shared/source/gen12lp/linux/product_helper_rkl.cpp b/shared/source/gen12lp/linux/product_helper_rkl.cpp index 44eaf1764b..79fb385f7f 100644 --- a/shared/source/gen12lp/linux/product_helper_rkl.cpp +++ b/shared/source/gen12lp/linux/product_helper_rkl.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ROCKETLAKE; #include "shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl" diff --git a/shared/source/gen12lp/linux/product_helper_tgllp.cpp b/shared/source/gen12lp/linux/product_helper_tgllp.cpp index 4f396593d4..6548e66178 100644 --- a/shared/source/gen12lp/linux/product_helper_tgllp.cpp +++ b/shared/source/gen12lp/linux/product_helper_tgllp.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP; #include "shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl" diff --git a/shared/source/gen12lp/rkl/os_agnostic_product_helper_rkl.inl b/shared/source/gen12lp/rkl/os_agnostic_product_helper_rkl.inl index 76697b8a68..e0e81b8bbd 100644 --- a/shared/source/gen12lp/rkl/os_agnostic_product_helper_rkl.inl +++ b/shared/source/gen12lp/rkl/os_agnostic_product_helper_rkl.inl @@ -21,11 +21,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::RKL; -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { 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 cf76d495d0..a15158ac7c 100644 --- a/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl +++ b/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl @@ -23,11 +23,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::TGL; -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { diff --git a/shared/source/gen12lp/windows/product_helper_adln.cpp b/shared/source/gen12lp/windows/product_helper_adln.cpp index a5d642f5a7..5a6b0aac7d 100644 --- a/shared/source/gen12lp/windows/product_helper_adln.cpp +++ b/shared/source/gen12lp/windows/product_helper_adln.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ALDERLAKE_N; #include "shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl" diff --git a/shared/source/gen12lp/windows/product_helper_adlp.cpp b/shared/source/gen12lp/windows/product_helper_adlp.cpp index 93828b79d7..e0f2bf93a2 100644 --- a/shared/source/gen12lp/windows/product_helper_adlp.cpp +++ b/shared/source/gen12lp/windows/product_helper_adlp.cpp @@ -14,8 +14,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ALDERLAKE_P; #include "shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl" diff --git a/shared/source/gen12lp/windows/product_helper_adls.cpp b/shared/source/gen12lp/windows/product_helper_adls.cpp index a5ed5ef9a4..c5ef2efd36 100644 --- a/shared/source/gen12lp/windows/product_helper_adls.cpp +++ b/shared/source/gen12lp/windows/product_helper_adls.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ALDERLAKE_S; #include "shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl" diff --git a/shared/source/gen12lp/windows/product_helper_dg1.cpp b/shared/source/gen12lp/windows/product_helper_dg1.cpp index d55eec1796..4ea99b114b 100644 --- a/shared/source/gen12lp/windows/product_helper_dg1.cpp +++ b/shared/source/gen12lp/windows/product_helper_dg1.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_DG1; #include "shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl" diff --git a/shared/source/gen12lp/windows/product_helper_rkl.cpp b/shared/source/gen12lp/windows/product_helper_rkl.cpp index b4d0fac1e0..2eb7056084 100644 --- a/shared/source/gen12lp/windows/product_helper_rkl.cpp +++ b/shared/source/gen12lp/windows/product_helper_rkl.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_ROCKETLAKE; #include "shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl" diff --git a/shared/source/gen12lp/windows/product_helper_tgllp.cpp b/shared/source/gen12lp/windows/product_helper_tgllp.cpp index a61835fb2b..5c7bb5c528 100644 --- a/shared/source/gen12lp/windows/product_helper_tgllp.cpp +++ b/shared/source/gen12lp/windows/product_helper_tgllp.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_TIGERLAKE_LP; #include "shared/source/gen12lp/os_agnostic_product_helper_gen12lp.inl" diff --git a/shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl b/shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl index 1701e31706..53f340b5e5 100644 --- a/shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl +++ b/shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl @@ -8,11 +8,6 @@ #include "aubstream/product_family.h" namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::BDW; -} - template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Bdw; diff --git a/shared/source/gen8/compiler_product_helper_bdw.inl b/shared/source/gen8/compiler_product_helper_bdw.inl deleted file mode 100644 index 2ccf2b8f93..0000000000 --- a/shared/source/gen8/compiler_product_helper_bdw.inl +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (C) 2021-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -template <> -bool CompilerProductHelperHw::isStatelessToStatefulBufferOffsetSupported() const { - return false; -} - -template <> -uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { - return 0x100030008; -} diff --git a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp index b168570989..da2c6e8f8e 100644 --- a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp +++ b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp @@ -15,9 +15,24 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" -namespace NEO { +#include "platforms.h" + +namespace NEO { +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::BDW; +} + +template <> +bool CompilerProductHelperHw::isStatelessToStatefulBufferOffsetSupported() const { + return false; +} + +template <> +uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { + return 0x100030008; +} -#include "shared/source/gen8/compiler_product_helper_bdw.inl" static EnableCompilerProductHelper enableCompilerProductHelperBDW; } // namespace NEO diff --git a/shared/source/gen8/linux/product_helper_bdw.cpp b/shared/source/gen8/linux/product_helper_bdw.cpp index b880e39786..a6305f8707 100644 --- a/shared/source/gen8/linux/product_helper_bdw.cpp +++ b/shared/source/gen8/linux/product_helper_bdw.cpp @@ -11,8 +11,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_BROADWELL; #include "shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl" diff --git a/shared/source/gen8/windows/product_helper_bdw.cpp b/shared/source/gen8/windows/product_helper_bdw.cpp index 0e44ee60fd..d8854b1a4a 100644 --- a/shared/source/gen8/windows/product_helper_bdw.cpp +++ b/shared/source/gen8/windows/product_helper_bdw.cpp @@ -11,8 +11,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_BROADWELL; #include "shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl" diff --git a/shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl b/shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl index b3ef29f295..598e1fe4ea 100644 --- a/shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl +++ b/shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl @@ -8,11 +8,6 @@ #include "aubstream/product_family.h" namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::APL; -} - template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Bxt; diff --git a/shared/source/gen9/cfl/os_agnostic_product_helper_cfl.inl b/shared/source/gen9/cfl/os_agnostic_product_helper_cfl.inl index 771a5a5787..81b929d788 100644 --- a/shared/source/gen9/cfl/os_agnostic_product_helper_cfl.inl +++ b/shared/source/gen9/cfl/os_agnostic_product_helper_cfl.inl @@ -5,30 +5,9 @@ * */ -#include "shared/source/gen9/cfl/device_ids_configs_cfl.h" - #include "aubstream/product_family.h" -#include "platforms.h" - -#include namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - auto deviceId = hwInfo.platform.usDeviceID; - bool isCfl = (std::find(cflDeviceIds.begin(), cflDeviceIds.end(), deviceId) != cflDeviceIds.end()); - bool isWhl = (std::find(whlDeviceIds.begin(), whlDeviceIds.end(), deviceId) != whlDeviceIds.end()); - bool isCml = (std::find(cmlDeviceIds.begin(), cmlDeviceIds.end(), deviceId) != cmlDeviceIds.end()); - - if (isCfl) { - return AOT::CFL; - } else if (isCml) { - return AOT::CML; - } else if (isWhl) { - return AOT::WHL; - } - return AOT::UNKNOWN_ISA; -} template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { diff --git a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp index 5060189b75..fe8011d17c 100644 --- a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp @@ -15,6 +15,8 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" +#include "platforms.h" + namespace NEO { template <> @@ -27,6 +29,11 @@ uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { return 6; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::APL; +} + static EnableCompilerProductHelper enableCompilerProductHelperBXT; } // namespace NEO diff --git a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp index 1ea2bf7f54..19ce90e49a 100644 --- a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/gen9/cfl/device_ids_configs_cfl.h" #include "shared/source/helpers/compiler_aot_config_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" @@ -15,12 +16,33 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" +#include "platforms.h" + +#include + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100030006; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + auto deviceId = hwInfo.platform.usDeviceID; + bool isCfl = (std::find(cflDeviceIds.begin(), cflDeviceIds.end(), deviceId) != cflDeviceIds.end()); + bool isWhl = (std::find(whlDeviceIds.begin(), whlDeviceIds.end(), deviceId) != whlDeviceIds.end()); + bool isCml = (std::find(cmlDeviceIds.begin(), cmlDeviceIds.end(), deviceId) != cmlDeviceIds.end()); + + if (isCfl) { + return AOT::CFL; + } else if (isCml) { + return AOT::CML; + } else if (isWhl) { + return AOT::WHL; + } + return AOT::UNKNOWN_ISA; +} + static EnableCompilerProductHelper enableCompilerProductHelperCFL; } // namespace NEO diff --git a/shared/source/gen9/enable_compiler_product_helper_glk.cpp b/shared/source/gen9/enable_compiler_product_helper_glk.cpp index 4419aa0b31..07838711d2 100644 --- a/shared/source/gen9/enable_compiler_product_helper_glk.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_glk.cpp @@ -15,6 +15,8 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { @@ -26,6 +28,11 @@ uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { return 6; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::GLK; +} + static EnableCompilerProductHelper enableCompilerProductHelperGLK; } // namespace NEO diff --git a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp index 5e97411dc6..7e548666dc 100644 --- a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/gen9/kbl/device_ids_configs_kbl.h" #include "shared/source/helpers/compiler_aot_config_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" @@ -15,12 +16,30 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" +#include "platforms.h" + +#include + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { return 0x100030006; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + auto deviceId = hwInfo.platform.usDeviceID; + bool isKbl = (std::find(kblDeviceIds.begin(), kblDeviceIds.end(), deviceId) != kblDeviceIds.end()); + bool isAml = (std::find(amlDeviceIds.begin(), amlDeviceIds.end(), deviceId) != amlDeviceIds.end()); + + if (isKbl) { + return AOT::KBL; + } else if (isAml) { + return AOT::AML; + } + return AOT::UNKNOWN_ISA; +} + static EnableCompilerProductHelper enableCompilerProductHelperKBL; } // namespace NEO diff --git a/shared/source/gen9/enable_compiler_product_helper_skl.cpp b/shared/source/gen9/enable_compiler_product_helper_skl.cpp index d6c1a56a14..5ce7cb83cb 100644 --- a/shared/source/gen9/enable_compiler_product_helper_skl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_skl.cpp @@ -15,6 +15,8 @@ #include "shared/source/helpers/compiler_product_helper_disable_split_matrix_multiply_accumulate.inl" #include "shared/source/helpers/compiler_product_helper_disable_subgroup_local_block_io.inl" +#include "platforms.h" + namespace NEO { template <> @@ -22,6 +24,11 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareIn return 0x100030008; } +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return AOT::SKL; +} + static EnableCompilerProductHelper enableCompilerProductHelperSKL; } // namespace NEO diff --git a/shared/source/gen9/glk/os_agnostic_product_helper_glk.inl b/shared/source/gen9/glk/os_agnostic_product_helper_glk.inl index e0a35aba75..bb4d6b1e6b 100644 --- a/shared/source/gen9/glk/os_agnostic_product_helper_glk.inl +++ b/shared/source/gen9/glk/os_agnostic_product_helper_glk.inl @@ -8,11 +8,6 @@ #include "aubstream/product_family.h" namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::GLK; -} - template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Glk; diff --git a/shared/source/gen9/kbl/os_agnostic_product_helper_kbl.inl b/shared/source/gen9/kbl/os_agnostic_product_helper_kbl.inl index b07adf73ba..64dd164c99 100644 --- a/shared/source/gen9/kbl/os_agnostic_product_helper_kbl.inl +++ b/shared/source/gen9/kbl/os_agnostic_product_helper_kbl.inl @@ -5,27 +5,9 @@ * */ -#include "shared/source/gen9/kbl/device_ids_configs_kbl.h" - #include "aubstream/product_family.h" -#include "platforms.h" - -#include namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - auto deviceId = hwInfo.platform.usDeviceID; - bool isKbl = (std::find(kblDeviceIds.begin(), kblDeviceIds.end(), deviceId) != kblDeviceIds.end()); - bool isAml = (std::find(amlDeviceIds.begin(), amlDeviceIds.end(), deviceId) != amlDeviceIds.end()); - - if (isKbl) { - return AOT::KBL; - } else if (isAml) { - return AOT::AML; - } - return AOT::UNKNOWN_ISA; -} template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { diff --git a/shared/source/gen9/linux/product_helper_bxt.cpp b/shared/source/gen9/linux/product_helper_bxt.cpp index 21bea9d6ae..d6168058d0 100644 --- a/shared/source/gen9/linux/product_helper_bxt.cpp +++ b/shared/source/gen9/linux/product_helper_bxt.cpp @@ -13,8 +13,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_BROXTON; #include "shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl" diff --git a/shared/source/gen9/linux/product_helper_glk.cpp b/shared/source/gen9/linux/product_helper_glk.cpp index f800583376..8fc1320743 100644 --- a/shared/source/gen9/linux/product_helper_glk.cpp +++ b/shared/source/gen9/linux/product_helper_glk.cpp @@ -13,8 +13,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_GEMINILAKE; #include "shared/source/gen9/glk/os_agnostic_product_helper_glk.inl" diff --git a/shared/source/gen9/linux/product_helper_skl.cpp b/shared/source/gen9/linux/product_helper_skl.cpp index 56184acf11..f324eb0330 100644 --- a/shared/source/gen9/linux/product_helper_skl.cpp +++ b/shared/source/gen9/linux/product_helper_skl.cpp @@ -11,8 +11,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_SKYLAKE; #include "shared/source/gen9/skl/os_agnostic_product_helper_skl.inl" diff --git a/shared/source/gen9/skl/os_agnostic_product_helper_skl.inl b/shared/source/gen9/skl/os_agnostic_product_helper_skl.inl index fbcab9f05d..8b1c8846a6 100644 --- a/shared/source/gen9/skl/os_agnostic_product_helper_skl.inl +++ b/shared/source/gen9/skl/os_agnostic_product_helper_skl.inl @@ -8,11 +8,6 @@ #include "aubstream/product_family.h" namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::SKL; -} - template <> std::optional ProductHelperHw::getAubStreamProductFamily() const { return aub_stream::ProductFamily::Skl; diff --git a/shared/source/gen9/windows/product_helper_bxt.cpp b/shared/source/gen9/windows/product_helper_bxt.cpp index 2f236b8105..763b5c8a89 100644 --- a/shared/source/gen9/windows/product_helper_bxt.cpp +++ b/shared/source/gen9/windows/product_helper_bxt.cpp @@ -10,8 +10,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_BROXTON; #include "shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl" diff --git a/shared/source/gen9/windows/product_helper_glk.cpp b/shared/source/gen9/windows/product_helper_glk.cpp index cf906cd846..9e8f7f19ad 100644 --- a/shared/source/gen9/windows/product_helper_glk.cpp +++ b/shared/source/gen9/windows/product_helper_glk.cpp @@ -10,8 +10,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_GEMINILAKE; #include "shared/source/gen9/glk/os_agnostic_product_helper_glk.inl" diff --git a/shared/source/gen9/windows/product_helper_skl.cpp b/shared/source/gen9/windows/product_helper_skl.cpp index d1afb1577c..180a538df6 100644 --- a/shared/source/gen9/windows/product_helper_skl.cpp +++ b/shared/source/gen9/windows/product_helper_skl.cpp @@ -10,8 +10,6 @@ #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_bdw_and_later.inl" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_SKYLAKE; #include "shared/source/gen9/skl/os_agnostic_product_helper_skl.inl" diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index a635e14ae2..0112375d98 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -185,7 +185,7 @@ endif() if(SUPPORT_MTL_AND_LATER) list(APPEND NEO_CORE_HELPERS - ${CMAKE_CURRENT_SOURCE_DIR}/compiler_aot_config_mtl_and_later.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_mtl_and_later.inl ) endif() diff --git a/shared/source/helpers/compiler_product_helper.cpp b/shared/source/helpers/compiler_product_helper.cpp index 0ff813134f..ce24749782 100644 --- a/shared/source/helpers/compiler_product_helper.cpp +++ b/shared/source/helpers/compiler_product_helper.cpp @@ -7,8 +7,17 @@ #include "shared/source/helpers/compiler_product_helper.h" +#include "shared/source/debug_settings/debug_settings_manager.h" + namespace NEO { CompilerProductHelperCreateFunctionType compilerProductHelperFactory[IGFX_MAX_PRODUCT] = {}; +uint32_t CompilerProductHelper::getHwIpVersion(const HardwareInfo &hwInfo) const { + if (DebugManager.flags.OverrideHwIpVersion.get() != -1) { + return DebugManager.flags.OverrideHwIpVersion.get(); + } + return getProductConfigFromHwInfo(hwInfo); +} + } // namespace NEO diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 0e23766123..68512b48eb 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -56,8 +56,10 @@ class CompilerProductHelper { virtual std::string getDeviceExtensions(const HardwareInfo &hwInfo, const ReleaseHelper *releaseHelper) const = 0; virtual ~CompilerProductHelper() = default; + uint32_t getHwIpVersion(const HardwareInfo &hwInfo) const; protected: + virtual uint32_t getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const = 0; CompilerProductHelper() = default; }; @@ -93,6 +95,7 @@ class CompilerProductHelperHw : public CompilerProductHelper { ~CompilerProductHelperHw() override = default; protected: + uint32_t getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const override; CompilerProductHelperHw() = default; }; diff --git a/shared/source/helpers/compiler_product_helper_base.inl b/shared/source/helpers/compiler_product_helper_base.inl index 240b2316bd..9e41db1871 100644 --- a/shared/source/helpers/compiler_product_helper_base.inl +++ b/shared/source/helpers/compiler_product_helper_base.inl @@ -10,6 +10,7 @@ #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/compiler_product_helper.h" +#include "shared/source/helpers/hw_info.h" namespace NEO { diff --git a/shared/source/helpers/compiler_aot_config_mtl_and_later.inl b/shared/source/helpers/compiler_product_helper_mtl_and_later.inl similarity index 62% rename from shared/source/helpers/compiler_aot_config_mtl_and_later.inl rename to shared/source/helpers/compiler_product_helper_mtl_and_later.inl index a589ee5c06..69fe11c481 100644 --- a/shared/source/helpers/compiler_aot_config_mtl_and_later.inl +++ b/shared/source/helpers/compiler_product_helper_mtl_and_later.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -10,6 +10,10 @@ namespace NEO { template +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return hwInfo.ipVersion.value; +} +template void CompilerProductHelperHw::setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const { hwInfo.ipVersion = config; } diff --git a/shared/source/os_interface/CMakeLists.txt b/shared/source/os_interface/CMakeLists.txt index 1d56806749..d8b92ac05c 100644 --- a/shared/source/os_interface/CMakeLists.txt +++ b/shared/source/os_interface/CMakeLists.txt @@ -54,9 +54,5 @@ if(SUPPORT_DG2_AND_LATER) list(APPEND NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_dg2_and_later.inl) endif() -if(SUPPORT_MTL_AND_LATER) - list(APPEND NEO_CORE_OS_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_mtl_and_later.inl) -endif() - set_property(GLOBAL PROPERTY NEO_CORE_OS_INTERFACE ${NEO_CORE_OS_INTERFACE}) add_subdirectories() diff --git a/shared/source/os_interface/linux/ioctl_helper.cpp b/shared/source/os_interface/linux/ioctl_helper.cpp index c07628aa1c..e90522637c 100644 --- a/shared/source/os_interface/linux/ioctl_helper.cpp +++ b/shared/source/os_interface/linux/ioctl_helper.cpp @@ -10,6 +10,7 @@ #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/ptr_math.h" @@ -19,7 +20,6 @@ #include "shared/source/os_interface/linux/i915.h" #include "shared/source/os_interface/linux/memory_info.h" #include "shared/source/os_interface/linux/os_context_linux.h" -#include "shared/source/os_interface/product_helper.h" #include #include @@ -58,8 +58,8 @@ void IoctlHelper::fillExecObject(ExecObject &execObject, uint32_t handle, uint64 void IoctlHelper::setupIpVersion() { auto &rootDeviceEnvironment = drm.getRootDeviceEnvironment(); auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - auto &productHelper = rootDeviceEnvironment.getHelper(); - hwInfo.ipVersion.value = productHelper.getHwIpVersion(hwInfo); + auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); + hwInfo.ipVersion.value = compilerProductHelper.getHwIpVersion(hwInfo); } void IoctlHelper::logExecObject(const ExecObject &execObject, std::stringstream &logger, size_t size) { diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index e37ed988a5..b5cd0ccabe 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -90,7 +90,6 @@ class ProductHelper { virtual bool obtainBlitterPreference(const HardwareInfo &hwInfo) const = 0; virtual bool isBlitterFullySupported(const HardwareInfo &hwInfo) const = 0; virtual bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const = 0; - virtual uint32_t getHwIpVersion(const HardwareInfo &hwInfo) const = 0; virtual uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const = 0; virtual uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0; virtual uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0; @@ -215,6 +214,5 @@ class ProductHelper { virtual LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0; virtual void fillScmPropertiesSupportStructureBase(StateComputeModePropertiesSupport &propertiesSupport) const = 0; - virtual uint32_t getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const = 0; }; } // namespace NEO diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 15a90d5dc8..130ce025d6 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -212,14 +212,6 @@ uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo return CommonConstants::invalidStepping; } -template -uint32_t ProductHelperHw::getHwIpVersion(const HardwareInfo &hwInfo) const { - if (DebugManager.flags.OverrideHwIpVersion.get() != -1) { - return DebugManager.flags.OverrideHwIpVersion.get(); - } - return getProductConfigFromHwInfo(hwInfo); -} - template uint32_t ProductHelperHw::getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (getSteppingFromHwRevId(hwInfo)) { diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 448a691c0a..136bbb0862 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -44,7 +44,6 @@ class ProductHelperHw : public ProductHelper { bool isBlitterFullySupported(const HardwareInfo &hwInfo) const override; bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const override; bool overrideGfxPartitionLayoutForWsl() const override; - uint32_t getHwIpVersion(const HardwareInfo &hwInfo) const override; uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const override; uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override; uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override; @@ -169,7 +168,6 @@ class ProductHelperHw : public ProductHelper { void enableCompression(HardwareInfo *hwInfo) const; void enableBlitterOperationsSupport(HardwareInfo *hwInfo) const; bool getConcurrentAccessMemCapabilitiesSupported(UsmAccessCapabilities capability) const; - uint32_t getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const override; uint64_t getHostMemCapabilitiesValue() const; bool getHostMemCapabilitiesSupported(const HardwareInfo *hwInfo) const; LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/os_interface/product_helper_mtl_and_later.inl b/shared/source/os_interface/product_helper_mtl_and_later.inl deleted file mode 100644 index 90c91baddd..0000000000 --- a/shared/source/os_interface/product_helper_mtl_and_later.inl +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (C) 2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/os_interface/product_helper.h" - -namespace NEO { -template -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return hwInfo.ipVersion.value; -} -} // namespace NEO diff --git a/shared/source/os_interface/windows/wddm/wddm_additional_adapter_info_options.cpp b/shared/source/os_interface/windows/wddm/wddm_additional_adapter_info_options.cpp index ca441f01c3..7c15712ac5 100644 --- a/shared/source/os_interface/windows/wddm/wddm_additional_adapter_info_options.cpp +++ b/shared/source/os_interface/windows/wddm/wddm_additional_adapter_info_options.cpp @@ -6,8 +6,8 @@ */ #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" #include "shared/source/os_interface/windows/wddm/wddm.h" namespace NEO { @@ -15,7 +15,7 @@ namespace NEO { void Wddm::populateAdditionalAdapterInfoOptions(const ADAPTER_INFO_KMD &adapterInfo) { } void Wddm::populateIpVersion(HardwareInfo &hwInfo) { - auto &productHelper = rootDeviceEnvironment.getHelper(); - hwInfo.ipVersion.value = productHelper.getHwIpVersion(hwInfo); + auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); + hwInfo.ipVersion.value = compilerProductHelper.getHwIpVersion(hwInfo); } } // namespace NEO diff --git a/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp b/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp index cbb62b0cba..2e541b9043 100644 --- a/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/enable_compiler_product_helper_pvc.cpp @@ -15,13 +15,40 @@ #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl" #include "shared/source/xe_hpc_core/hw_cmds.h" +#include "shared/source/xe_hpc_core/pvc/device_ids_configs_pvc.h" #include "compiler_product_helper_pvc.inl" - +#include "platforms.h" namespace NEO { -static EnableCompilerProductHelper enableCompilerProductHelperPVC; - +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + auto deviceId = hwInfo.platform.usDeviceID; + bool isPvcXl = (std::find(pvcXlDeviceIds.begin(), pvcXlDeviceIds.end(), deviceId) != pvcXlDeviceIds.end()); + bool isPvcXt = (std::find(pvcXtDeviceIds.begin(), pvcXtDeviceIds.end(), deviceId) != pvcXtDeviceIds.end()); + if (isPvcXl) { + switch (hwInfo.platform.usRevId & PVC::pvcSteppingBits) { + case 0x0: + return AOT::PVC_XL_A0; + default: + case 0x1: + return AOT::PVC_XL_A0P; + } + } else if (isPvcXt) { + switch (hwInfo.platform.usRevId & PVC::pvcSteppingBits) { + case 0x3: + return AOT::PVC_XT_A0; + case 0x5: + return AOT::PVC_XT_B0; + case 0x6: + return AOT::PVC_XT_B1; + default: + case 0x7: + return AOT::PVC_XT_C0; + } + } + return AOT::UNKNOWN_ISA; +} template <> uint32_t CompilerProductHelperHw::matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const { HardwareIpVersion pvcConfig = ipVersion; @@ -29,4 +56,6 @@ uint32_t CompilerProductHelperHw::matchRevisionIdWithProductConfig(Har return pvcConfig.value; } +static EnableCompilerProductHelper enableCompilerProductHelperPVC; + } // namespace NEO 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 719127a7fd..35687b54a1 100644 --- a/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/linux/product_helper_pvc.cpp @@ -21,8 +21,6 @@ #include "shared/source/utilities/directory.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_PVC; namespace NEO { 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 b3bae39bc7..2ce2c650dc 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 @@ -58,36 +58,6 @@ uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - uint32_t stepping = getSteppingFromHwRevId(hwInfo); - if (stepping == CommonConstants::invalidStepping) { - return AOT::UNKNOWN_ISA; - } - - if (PVC::isXl(hwInfo)) { - switch (hwInfo.platform.usRevId) { - case 0x0: - return AOT::PVC_XL_A0; - default: - case 0x1: - return AOT::PVC_XL_A0P; - } - } else { - switch (hwInfo.platform.usRevId) { - case 0x3: - return AOT::PVC_XT_A0; - case 05: - return AOT::PVC_XT_B0; - case 06: - return AOT::PVC_XT_B1; - default: - case 07: - return AOT::PVC_XT_C0; - } - } -} - template <> bool ProductHelperHw::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const { return getSteppingFromHwRevId(hwInfo) >= REVISION_B; 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 033e86d114..dba6b4519b 100644 --- a/shared/source/xe_hpc_core/windows/product_helper_pvc.cpp +++ b/shared/source/xe_hpc_core/windows/product_helper_pvc.cpp @@ -12,8 +12,6 @@ #include "shared/source/os_interface/product_helper_xehp_and_later.inl" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_PVC; #include "shared/source/xe_hpc_core/os_agnostic_product_helper_xe_hpc_core.inl" diff --git a/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2.inl b/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2.inl index cd580e6f2e..d78ff0bb5d 100644 --- a/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2.inl +++ b/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2.inl @@ -7,6 +7,8 @@ #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" +#include "platforms.h" + namespace NEO { template <> uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { @@ -15,4 +17,32 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo & } return 0x200040010; } + +template <> +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + if (DG2::isG10(hwInfo)) { + switch (hwInfo.platform.usRevId) { + case 0x0: + return AOT::DG2_G10_A0; + case 0x1: + return AOT::DG2_G10_A1; + case 0x4: + return AOT::DG2_G10_B0; + case 0x8: + return AOT::DG2_G10_C0; + } + } else if (DG2::isG11(hwInfo)) { + switch (hwInfo.platform.usRevId) { + case 0x0: + return AOT::DG2_G11_A0; + case 0x4: + return AOT::DG2_G11_B0; + case 0x5: + return AOT::DG2_G11_B1; + } + } else if (DG2::isG12(hwInfo)) { + return AOT::DG2_G12_A0; + } + return AOT::UNKNOWN_ISA; +} } // namespace NEO diff --git a/shared/source/xe_hpg_core/dg2/definitions/os_agnostic_product_helper_dg2_extra.inl b/shared/source/xe_hpg_core/dg2/definitions/os_agnostic_product_helper_dg2_extra.inl deleted file mode 100644 index ab174547a2..0000000000 --- a/shared/source/xe_hpg_core/dg2/definitions/os_agnostic_product_helper_dg2_extra.inl +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2022-2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -namespace NEO { -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - if (DG2::isG10(hwInfo)) { - switch (hwInfo.platform.usRevId) { - case 0x0: - return AOT::DG2_G10_A0; - case 0x1: - return AOT::DG2_G10_A1; - case 0x4: - return AOT::DG2_G10_B0; - case 0x8: - return AOT::DG2_G10_C0; - } - } else if (DG2::isG11(hwInfo)) { - switch (hwInfo.platform.usRevId) { - case 0x0: - return AOT::DG2_G11_A0; - case 0x4: - return AOT::DG2_G11_B0; - case 0x5: - return AOT::DG2_G11_B1; - } - } else if (DG2::isG12(hwInfo)) { - return AOT::DG2_G12_A0; - } - return AOT::UNKNOWN_ISA; -} -} // namespace NEO 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 e33b0cce1a..143338f45f 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 @@ -10,7 +10,6 @@ #include "shared/source/memory_manager/memory_manager.h" #include "aubstream/product_family.h" -#include "os_agnostic_product_helper_dg2_extra.inl" namespace NEO { template <> diff --git a/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp b/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp index 88dc0ecf47..7b952d5870 100644 --- a/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp @@ -5,12 +5,12 @@ * */ -#include "shared/source/helpers/compiler_aot_config_mtl_and_later.inl" #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/compiler_product_helper_base.inl" #include "shared/source/helpers/compiler_product_helper_bdw_and_later.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "shared/source/helpers/compiler_product_helper_enable_subgroup_local_block_io.inl" +#include "shared/source/helpers/compiler_product_helper_mtl_and_later.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" 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 a434242c71..df44c3d388 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_dg2.cpp @@ -20,8 +20,6 @@ #include "shared/source/os_interface/product_helper_xehp_and_later.inl" #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_DG2; #include "shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.inl" 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 d2896e43ef..0066110ef2 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp @@ -10,12 +10,9 @@ #include "shared/source/os_interface/product_helper.h" #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_dg2_and_later.inl" -#include "shared/source/os_interface/product_helper_mtl_and_later.inl" #include "shared/source/os_interface/product_helper_xehp_and_later.inl" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_METEORLAKE; namespace NEO { diff --git a/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl b/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl index 0af8359eb9..efcdbbc748 100644 --- a/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl +++ b/shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl @@ -9,6 +9,7 @@ #include "shared/source/memory_manager/allocation_type.h" #include "aubstream/product_family.h" +#include "platforms.h" namespace NEO { template <> @@ -95,7 +96,7 @@ uint64_t ProductHelperHw::overridePatIndex(AllocationType allocation template <> int ProductHelperHw::getProductMaxPreferredSlmSize(const HardwareInfo &hwInfo, int preferredEnumValue) const { using PREFERRED_SLM_ALLOCATION_SIZE = typename XeHpgCoreFamily::INTERFACE_DESCRIPTOR_DATA::PREFERRED_SLM_ALLOCATION_SIZE; - if (getProductConfigFromHwInfo(hwInfo) == AOT::MTL_M_A0 || getProductConfigFromHwInfo(hwInfo) == AOT::MTL_P_A0) { + if (hwInfo.ipVersion.value == AOT::MTL_M_A0 || hwInfo.ipVersion.value == AOT::MTL_P_A0) { return static_cast(PREFERRED_SLM_ALLOCATION_SIZE::PREFERRED_SLM_ALLOCATION_SIZE_96K); } else { return preferredEnumValue; 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 e9f6072db5..a57989bd49 100644 --- a/shared/source/xe_hpg_core/windows/product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/windows/product_helper_dg2.cpp @@ -15,8 +15,6 @@ #include "shared/source/os_interface/product_helper_xehp_and_later.inl" #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_DG2; #include "shared/source/xe_hpg_core/dg2/os_agnostic_product_helper_dg2.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 b5e1d89dbc..6c66dd8b0b 100644 --- a/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp @@ -9,12 +9,9 @@ #include "shared/source/os_interface/product_helper.h" #include "shared/source/os_interface/product_helper.inl" #include "shared/source/os_interface/product_helper_dg2_and_later.inl" -#include "shared/source/os_interface/product_helper_mtl_and_later.inl" #include "shared/source/os_interface/product_helper_xehp_and_later.inl" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" -#include "platforms.h" - constexpr static auto gfxProduct = IGFX_METEORLAKE; #include "shared/source/xe_hpg_core/mtl/os_agnostic_product_helper_mtl.inl" diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index f2f8daee21..20a328b242 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -14,8 +14,6 @@ #include "shared/source/os_interface/product_helper.h" #include "shared/source/os_interface/product_helper_hw.h" -#include "platforms.h" - namespace NEO { template <> @@ -119,11 +117,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping return CommonConstants::invalidStepping; } -template <> -uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return AOT::UNKNOWN_ISA; -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { return CommonConstants::invalidStepping; diff --git a/shared/test/common/tests_configuration.cpp b/shared/test/common/tests_configuration.cpp index 41f2d3d5d4..3953460cba 100644 --- a/shared/test/common/tests_configuration.cpp +++ b/shared/test/common/tests_configuration.cpp @@ -40,7 +40,6 @@ void adjustHwInfoForTests(HardwareInfo &hwInfoForTests, uint32_t euPerSubSlice, gtSystemInfo.MaxSlicesSupported = std::max(gtSystemInfo.MaxSlicesSupported, gtSystemInfo.SliceCount); gtSystemInfo.MaxSubSlicesSupported = std::max(gtSystemInfo.MaxSubSlicesSupported, gtSystemInfo.SubSliceCount); - auto productHelper = ProductHelper::create(hwInfoForTests.platform.eProductFamily); - hwInfoForTests.ipVersion.value = productHelper->getHwIpVersion(hwInfoForTests); + hwInfoForTests.ipVersion.value = compilerProductHelper->getHwIpVersion(hwInfoForTests); } } // namespace NEO diff --git a/shared/test/unit_test/device_binary_format/device_binary_format_ar_tests.cpp b/shared/test/unit_test/device_binary_format/device_binary_format_ar_tests.cpp index 0a11c3a008..ae3367178f 100644 --- a/shared/test/unit_test/device_binary_format/device_binary_format_ar_tests.cpp +++ b/shared/test/unit_test/device_binary_format/device_binary_format_ar_tests.cpp @@ -60,10 +60,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToFindMatchingBinariesThenUnpackingFa TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItAsABestMatch) { PatchTokensTestData::ValidEmptyProgram programTokens; NEO::MockExecutionEnvironment mockExecutionEnvironment{}; - const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; NEO::HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); NEO::Ar::ArEncoder encoder; std::string requiredProduct = NEO::hardwarePrefix[productFamily]; @@ -102,10 +102,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItA TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTargetDeviceBinaryIsSet) { PatchTokensTestData::ValidEmptyProgram programTokens; NEO::MockExecutionEnvironment mockExecutionEnvironment{}; - const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; NEO::HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); NEO::Ar::ArEncoder encoder; std::string requiredProduct = NEO::hardwarePrefix[productFamily]; @@ -134,10 +134,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTar TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch) { PatchTokensTestData::ValidEmptyProgram programTokens; NEO::MockExecutionEnvironment mockExecutionEnvironment{}; - const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; NEO::HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); NEO::Ar::ArEncoder encoder; std::string requiredProduct = NEO::hardwarePrefix[productFamily]; @@ -152,7 +152,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch) NEO::TargetDevice target; target.coreFamily = static_cast(programTokens.header->Device); - target.aotConfig.value = productHelper.getHwIpVersion(hwInfo); + target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); target.stepping = programTokens.header->SteppingId; target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes; @@ -244,10 +244,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry PatchTokensTestData::ValidEmptyProgram programTokensWrongTokenVersion; NEO::MockExecutionEnvironment mockExecutionEnvironment{}; - const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; NEO::HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig); @@ -264,7 +264,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry NEO::TargetDevice target; target.coreFamily = static_cast(programTokens.header->Device); - target.aotConfig.value = productHelper.getHwIpVersion(hwInfo); + target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); target.stepping = programTokens.header->SteppingId; target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes; @@ -353,10 +353,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductFamil TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfigAvailableThenUseIr) { PatchTokensTestData::ValidEmptyProgram programTokens; NEO::MockExecutionEnvironment mockExecutionEnvironment{}; - const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; NEO::HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig); std::string requiredProduct = NEO::hardwarePrefix[productFamily]; @@ -375,7 +375,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfi target.coreFamily = static_cast(programTokens.header->Device); target.stepping = programTokens.header->SteppingId; target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes; - target.aotConfig.value = productHelper.getHwIpVersion(hwInfo); + target.aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); auto arData = encoder.encode(); std::string unpackErrors; @@ -578,10 +578,10 @@ TEST(UnpackSingleDeviceBinaryAr, WhenCouldNotFindBinaryWithRightPointerSizeThenU NEO::Ar::ArEncoder encoder; NEO::MockExecutionEnvironment mockExecutionEnvironment{}; - const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + const auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo; NEO::HardwareIpVersion aotConfig = {0}; - aotConfig.value = productHelper.getHwIpVersion(hwInfo); + aotConfig.value = compilerProductHelper.getHwIpVersion(hwInfo); std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig); std::string requiredProduct = NEO::hardwarePrefix[productFamily]; diff --git a/shared/test/unit_test/fixtures/product_config_fixture.h b/shared/test/unit_test/fixtures/product_config_fixture.h index a9f8e17763..22a988a00b 100644 --- a/shared/test/unit_test/fixtures/product_config_fixture.h +++ b/shared/test/unit_test/fixtures/product_config_fixture.h @@ -7,10 +7,10 @@ #pragma once +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/product_config_helper.h" -#include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/test_base.h" @@ -24,10 +24,10 @@ struct ProductConfigTest : public T { void SetUp() override { T::SetUp(); hwInfo = *NEO::defaultHwInfo; - productHelper = NEO::ProductHelper::create(productFamily); + compilerProductHelper = NEO::CompilerProductHelper::create(productFamily); } - std::unique_ptr productHelper = nullptr; + std::unique_ptr compilerProductHelper = nullptr; NEO::HardwareInfo hwInfo = {}; uint32_t productConfig = AOT::UNKNOWN_ISA; }; diff --git a/shared/test/unit_test/gen11/ehl/test_product_helper_ehl.cpp b/shared/test/unit_test/gen11/ehl/test_product_helper_ehl.cpp index fc7196ea16..e4d6b18839 100644 --- a/shared/test/unit_test/gen11/ehl/test_product_helper_ehl.cpp +++ b/shared/test/unit_test/gen11/ehl/test_product_helper_ehl.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen11/hw_cmds_ehl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -65,9 +66,8 @@ EHLTEST_F(EhlProductHelper, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTabl } } -EHLTEST_F(EhlProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::EHL); +EHLTEST_F(EhlProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::EHL); } EHLTEST_F(EhlProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen11/icllp/test_product_helper_icllp.cpp b/shared/test/unit_test/gen11/icllp/test_product_helper_icllp.cpp index cb94f6d63e..d12f41504a 100644 --- a/shared/test/unit_test/gen11/icllp/test_product_helper_icllp.cpp +++ b/shared/test/unit_test/gen11/icllp/test_product_helper_icllp.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen11/hw_cmds_icllp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -97,8 +98,8 @@ ICLLPTEST_F(IcllpProductHelper, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatu } } -ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(*defaultHwInfo), AOT::ICL); +ICLLPTEST_F(IcllpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(*defaultHwInfo), AOT::ICL); } ICLLPTEST_F(IcllpProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen11/lkf/test_product_helper_lkf.cpp b/shared/test/unit_test/gen11/lkf/test_product_helper_lkf.cpp index d4fe9593c5..7fe63481d2 100644 --- a/shared/test/unit_test/gen11/lkf/test_product_helper_lkf.cpp +++ b/shared/test/unit_test/gen11/lkf/test_product_helper_lkf.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen11/hw_cmds_lkf.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -83,9 +84,8 @@ LKFTEST_F(LkfProductHelper, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTabl } } -LKFTEST_F(LkfProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::LKF); +LKFTEST_F(LkfProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::LKF); } LKFTEST_F(LkfProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen12lp/adln/test_product_helper_adln.cpp b/shared/test/unit_test/gen12lp/adln/test_product_helper_adln.cpp index ca969394b1..7e8f7e98c0 100644 --- a/shared/test/unit_test/gen12lp/adln/test_product_helper_adln.cpp +++ b/shared/test/unit_test/gen12lp/adln/test_product_helper_adln.cpp @@ -76,8 +76,8 @@ ADLNTEST_F(AdlnProductHelper, whenGettingAubstreamProductFamilyThenProperEnumVal EXPECT_EQ(aub_stream::ProductFamily::Adln, productHelper->getAubStreamProductFamily()); } -ADLNTEST_F(AdlnProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::ADL_N); +ADLNTEST_F(AdlnProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_N); } ADLNTEST_F(AdlnProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen12lp/adlp/test_product_helper_adlp.cpp b/shared/test/unit_test/gen12lp/adlp/test_product_helper_adlp.cpp index 8f7e3ee75c..dd95ec0657 100644 --- a/shared/test/unit_test/gen12lp/adlp/test_product_helper_adlp.cpp +++ b/shared/test/unit_test/gen12lp/adlp/test_product_helper_adlp.cpp @@ -75,9 +75,9 @@ ADLPTEST_F(AdlpProductHelper, whenGettingAubstreamProductFamilyThenProperEnumVal EXPECT_EQ(aub_stream::ProductFamily::Adlp, productHelper->getAubStreamProductFamily()); } -ADLPTEST_F(AdlpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { +ADLPTEST_F(AdlpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::ADL_P); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_P); } ADLPTEST_F(AdlpProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen12lp/adls/test_product_helper_adls.cpp b/shared/test/unit_test/gen12lp/adls/test_product_helper_adls.cpp index 527f996b7d..0cb67cc88c 100644 --- a/shared/test/unit_test/gen12lp/adls/test_product_helper_adls.cpp +++ b/shared/test/unit_test/gen12lp/adls/test_product_helper_adls.cpp @@ -75,9 +75,9 @@ ADLSTEST_F(AdlsProductHelper, whenGettingAubstreamProductFamilyThenProperEnumVal EXPECT_EQ(aub_stream::ProductFamily::Adls, productHelper->getAubStreamProductFamily()); } -ADLSTEST_F(AdlsProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { +ADLSTEST_F(AdlsProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::ADL_S); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::ADL_S); } ADLSTEST_F(AdlsProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen12lp/dg1/test_product_helper_dg1.cpp b/shared/test/unit_test/gen12lp/dg1/test_product_helper_dg1.cpp index f320458ca8..132ff36e63 100644 --- a/shared/test/unit_test/gen12lp/dg1/test_product_helper_dg1.cpp +++ b/shared/test/unit_test/gen12lp/dg1/test_product_helper_dg1.cpp @@ -133,8 +133,8 @@ DG1TEST_F(Dg1ProductHelper, whenOverrideGfxPartitionLayoutForWslThenReturnTrue) EXPECT_TRUE(productHelper->overrideGfxPartitionLayoutForWsl()); } -DG1TEST_F(Dg1ProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(*defaultHwInfo), AOT::DG1); +DG1TEST_F(Dg1ProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(*defaultHwInfo), AOT::DG1); } DG1TEST_F(Dg1ProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen12lp/rkl/test_product_helper_rkl.cpp b/shared/test/unit_test/gen12lp/rkl/test_product_helper_rkl.cpp index 3ffa93e432..227f02fef6 100644 --- a/shared/test/unit_test/gen12lp/rkl/test_product_helper_rkl.cpp +++ b/shared/test/unit_test/gen12lp/rkl/test_product_helper_rkl.cpp @@ -81,8 +81,8 @@ RKLTEST_F(RklHwInfo, givenRklWhenCheckL0ThenReturnTrue) { using RklProductHelper = ProductHelperTest; -RKLTEST_F(RklProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::RKL); +RKLTEST_F(RklProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::RKL); } RKLTEST_F(RklProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen12lp/tgllp/product_helper_tests_tgllp.cpp b/shared/test/unit_test/gen12lp/tgllp/product_helper_tests_tgllp.cpp index 05e4c44c16..8fe9db7ecf 100644 --- a/shared/test/unit_test/gen12lp/tgllp/product_helper_tests_tgllp.cpp +++ b/shared/test/unit_test/gen12lp/tgllp/product_helper_tests_tgllp.cpp @@ -236,6 +236,6 @@ TGLLPTEST_F(TgllpProductHelper, givenTgllpWhenObtainingBlitterPreferenceThenRetu EXPECT_FALSE(productHelper->obtainBlitterPreference(pInHwInfo)); } -TGLLPTEST_F(TgllpProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::TGL); +TGLLPTEST_F(TgllpProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::TGL); } diff --git a/shared/test/unit_test/gen8/bdw/test_product_helper_bdw.cpp b/shared/test/unit_test/gen8/bdw/test_product_helper_bdw.cpp index 872e3e34f5..d5a2e68ac1 100644 --- a/shared/test/unit_test/gen8/bdw/test_product_helper_bdw.cpp +++ b/shared/test/unit_test/gen8/bdw/test_product_helper_bdw.cpp @@ -82,9 +82,8 @@ BDWTEST_F(BdwProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIs EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme); } -BDWTEST_F(BdwProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::BDW); +BDWTEST_F(BdwProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::BDW); } BDWTEST_F(BdwProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen9/bxt/test_product_helper_bxt.cpp b/shared/test/unit_test/gen9/bxt/test_product_helper_bxt.cpp index 9c7fa4563a..27dd6dc37a 100644 --- a/shared/test/unit_test/gen9/bxt/test_product_helper_bxt.cpp +++ b/shared/test/unit_test/gen9/bxt/test_product_helper_bxt.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen9/hw_cmds_bxt.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -85,9 +86,9 @@ BXTTEST_F(BxtProductHelper, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTabl } } -BXTTEST_F(BxtProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { +BXTTEST_F(BxtProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::APL); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::APL); } BXTTEST_F(BxtProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen9/cfl/test_product_helper_cfl.cpp b/shared/test/unit_test/gen9/cfl/test_product_helper_cfl.cpp index be828b0ec6..2a83b847cb 100644 --- a/shared/test/unit_test/gen9/cfl/test_product_helper_cfl.cpp +++ b/shared/test/unit_test/gen9/cfl/test_product_helper_cfl.cpp @@ -9,6 +9,7 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen9/cfl/device_ids_configs_cfl.h" #include "shared/source/gen9/hw_cmds_cfl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -90,23 +91,23 @@ CFLTEST_F(CflProductHelper, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTabl } } -CFLTEST_F(CflProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { +CFLTEST_F(CflProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { for (const auto &deviceId : cflDeviceIds) { pInHwInfo.platform.usDeviceID = deviceId; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::CFL); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::CFL); } for (const auto &deviceId : cmlDeviceIds) { pInHwInfo.platform.usDeviceID = deviceId; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::CML); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::CML); } for (const auto &deviceId : whlDeviceIds) { pInHwInfo.platform.usDeviceID = deviceId; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::WHL); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::WHL); } pInHwInfo.platform.usDeviceID = 0u; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA); } CFLTEST_F(CflProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen9/glk/test_product_helper_glk.cpp b/shared/test/unit_test/gen9/glk/test_product_helper_glk.cpp index 900380a638..1bdc9ab8db 100644 --- a/shared/test/unit_test/gen9/glk/test_product_helper_glk.cpp +++ b/shared/test/unit_test/gen9/glk/test_product_helper_glk.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen9/hw_cmds_glk.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -85,9 +86,9 @@ GLKTEST_F(GlkProductHelper, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTabl } } -GLKTEST_F(GlkProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { +GLKTEST_F(GlkProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::GLK); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::GLK); } GLKTEST_F(GlkProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen9/kbl/test_product_helper_kbl.cpp b/shared/test/unit_test/gen9/kbl/test_product_helper_kbl.cpp index da7a84b977..74d3362503 100644 --- a/shared/test/unit_test/gen9/kbl/test_product_helper_kbl.cpp +++ b/shared/test/unit_test/gen9/kbl/test_product_helper_kbl.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen9/kbl/device_ids_configs_kbl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/hw_test.h" @@ -99,19 +100,19 @@ KBLTEST_F(KblProductHelper, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTabl } } -KBLTEST_F(KblProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { +KBLTEST_F(KblProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { for (const auto &deviceId : amlDeviceIds) { pInHwInfo.platform.usDeviceID = deviceId; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::AML); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::AML); } for (const auto &deviceId : kblDeviceIds) { pInHwInfo.platform.usDeviceID = deviceId; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::KBL); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::KBL); } pInHwInfo.platform.usDeviceID = 0u; - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA); } KBLTEST_F(KblProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/gen9/skl/test_product_helper_skl.cpp b/shared/test/unit_test/gen9/skl/test_product_helper_skl.cpp index 9759e1c635..3c222d2cb1 100644 --- a/shared/test/unit_test/gen9/skl/test_product_helper_skl.cpp +++ b/shared/test/unit_test/gen9/skl/test_product_helper_skl.cpp @@ -8,6 +8,7 @@ #include "shared/source/execution_environment/execution_environment.h" #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen9/hw_cmds_skl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/product_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" @@ -109,8 +110,8 @@ SKLTEST_F(SklProductHelper, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTabl } } -SKLTEST_F(SklProductHelper, givenProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { - EXPECT_EQ(productHelper->getHwIpVersion(pInHwInfo), AOT::SKL); +SKLTEST_F(SklProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCorrectMatchIsFound) { + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::SKL); } SKLTEST_F(SklProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp index 605eb3a7af..8930a2e5e9 100644 --- a/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp +++ b/shared/test/unit_test/helpers/compiler_product_helper_tests.cpp @@ -149,12 +149,11 @@ HWTEST2_F(CompilerProductHelperFixture, GivenPreXeHpThenMatrixMultiplyAccumulate } HWTEST2_F(CompilerProductHelperFixture, givenAotConfigWhenSetHwInfoRevisionIdThenCorrectValueIsSet, IsAtMostDg2) { + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); auto hwInfo = *defaultHwInfo; - auto &productHelper = getHelper(); - auto productConfig = productHelper.getHwIpVersion(*defaultHwInfo); + auto productConfig = compilerProductHelper.getHwIpVersion(*defaultHwInfo); HardwareIpVersion aotConfig = {0}; aotConfig.value = productConfig; - auto &compilerProductHelper = pDevice->getCompilerProductHelper(); compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig); EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.revision); EXPECT_EQ(hwInfo.ipVersion.value, aotConfig.value); @@ -279,4 +278,14 @@ HWTEST2_F(CompilerProductHelperFixture, givenConfigWhenMatchConfigWithRevIdThenP EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(config, 0x0), config); EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(config, 0x1), config); EXPECT_EQ(compilerProductHelper.matchRevisionIdWithProductConfig(config, 0x4), config); -} \ No newline at end of file +} + +HWTEST_F(CompilerProductHelperFixture, givenProductHelperWhenGetAndOverrideHwIpVersionThenCorrectMatchIsFound) { + DebugManagerStateRestore stateRestore; + auto &compilerProductHelper = pDevice->getCompilerProductHelper(); + auto &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo(); + uint32_t config = 0x1234; + DebugManager.flags.OverrideHwIpVersion.set(config); + hwInfo.ipVersion.value = 0x5678; + EXPECT_EQ(compilerProductHelper.getHwIpVersion(hwInfo), config); +} diff --git a/shared/test/unit_test/helpers/hw_aot_config_tests.cpp b/shared/test/unit_test/helpers/hw_aot_config_tests.cpp index 0a8085b261..d814d2cd8a 100644 --- a/shared/test/unit_test/helpers/hw_aot_config_tests.cpp +++ b/shared/test/unit_test/helpers/hw_aot_config_tests.cpp @@ -15,21 +15,19 @@ using namespace NEO; HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenSetHwInfoGmdIdThenCorrectValueIsSet, IsAtLeastMtl) { HardwareIpVersion aotConfig = {0}; aotConfig.value = productConfig; - MockExecutionEnvironment mockExecutionEnvironment{}; - auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig); + compilerProductHelper->setProductConfigForHwInfo(hwInfo, aotConfig); EXPECT_EQ(hwInfo.ipVersion.architecture, aotConfig.architecture); EXPECT_EQ(hwInfo.ipVersion.release, aotConfig.release); EXPECT_EQ(hwInfo.ipVersion.revision, aotConfig.revision); - auto ret = productHelper->getHwIpVersion(hwInfo); + auto ret = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(ret, productConfig); } HWTEST2_P(ProductConfigHwInfoTests, givenUnknownAotConfigWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) { hwInfo.ipVersion = {}; - auto ret = productHelper->getHwIpVersion(hwInfo); + auto ret = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(ret, AOT::UNKNOWN_ISA); } @@ -39,14 +37,14 @@ HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenGetProductConfigThenCorrec hwInfo.ipVersion.architecture = aotConfig.architecture; hwInfo.ipVersion.release = aotConfig.release; hwInfo.ipVersion.revision = aotConfig.revision; - auto ret = productHelper->getHwIpVersion(hwInfo); + auto ret = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(ret, productConfig); } TEST(ProductConfigHwInfoTest, givenDefaultAotConfigWhenGetProductConfigThenSameValueIsReturned) { MockExecutionEnvironment mockExecutionEnvironment{}; - auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); + auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); auto hwInfo = *defaultHwInfo; - auto ret = productHelper.getHwIpVersion(hwInfo); + auto ret = compilerProductHelper.getHwIpVersion(hwInfo); EXPECT_EQ(ret, hwInfo.ipVersion.value); } diff --git a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp index 5501a047eb..b6322f0e35 100644 --- a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/linux/engine_info.h" #include "shared/source/os_interface/linux/i915_prelim.h" #include "shared/source/os_interface/linux/ioctl_helper.h" @@ -589,12 +590,12 @@ TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenInitializatedThenIpVersionI TEST_F(IoctlHelperPrelimFixture, givenIoctlHelperWhenFailOnInitializationThenIpVersionIsCorrect) { auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo(); - auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); auto &ipVersion = hwInfo->ipVersion; ipVersion = {}; drm->failRetHwIpVersion = true; drm->ioctlHelper->setupIpVersion(); - auto config = productHelper.getHwIpVersion(*hwInfo); + auto config = compilerProductHelper.getHwIpVersion(*hwInfo); EXPECT_EQ(config, ipVersion.value); } diff --git a/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp b/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp index f7f13ecaf3..3893eca8f1 100644 --- a/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp +++ b/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_prelim.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/string.h" #include "shared/source/os_interface/linux/drm_neo.h" #include "shared/source/os_interface/linux/i915_prelim.h" @@ -552,8 +553,8 @@ TEST_F(IoctlPrelimHelperTests, whenGettingPreferredLocationRegionThenReturnCorre TEST_F(IoctlPrelimHelperTests, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect) { auto &hwInfo = *drm->getRootDeviceEnvironment().getHardwareInfo(); - auto &productHelper = drm->getRootDeviceEnvironment().getHelper(); - auto config = productHelper.getHwIpVersion(hwInfo); + auto &compilerProductHelper = drm->getRootDeviceEnvironment().getHelper(); + auto config = compilerProductHelper.getHwIpVersion(hwInfo); ioctlHelper.setupIpVersion(); EXPECT_EQ(config, hwInfo.ipVersion.value); diff --git a/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_upstream.cpp b/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_upstream.cpp index ad2bf32b25..57dc3ccc44 100644 --- a/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_upstream.cpp +++ b/shared/test/unit_test/os_interface/linux/ioctl_helper_tests_upstream.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/linux/engine_info.h" #include "shared/source/os_interface/linux/memory_info.h" #include "shared/source/os_interface/product_helper.h" @@ -506,8 +507,8 @@ TEST(IoctlHelperTestsUpstream, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect) IoctlHelperUpstream ioctlHelper{*drm}; auto &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); - auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); - auto config = productHelper.getHwIpVersion(hwInfo); + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + auto config = compilerProductHelper.getHwIpVersion(hwInfo); ioctlHelper.setupIpVersion(); EXPECT_EQ(config, hwInfo.ipVersion.value); diff --git a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp index ce00634e95..4268230e33 100644 --- a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/register_offsets.h" #include "shared/source/os_interface/linux/engine_info.h" #include "shared/source/os_interface/linux/i915_prelim.h" @@ -1143,8 +1144,8 @@ TEST(IoctlHelperXeTest, WhenSetupIpVersionIsCalledThenIpVersionIsCorrect) { auto xeIoctlHelper = std::make_unique(drm); auto &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(); - auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); - auto config = productHelper.getHwIpVersion(hwInfo); + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + auto config = compilerProductHelper.getHwIpVersion(hwInfo); xeIoctlHelper->setupIpVersion(); EXPECT_EQ(config, hwInfo.ipVersion.value); diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index 6b1fc5f90e..f1e5760217 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -34,6 +34,7 @@ using namespace NEO; ProductHelperTest::ProductHelperTest() { executionEnvironment = std::make_unique(); productHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + compilerProductHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper(); releaseHelper = executionEnvironment->rootDeviceEnvironments[0]->getReleaseHelper(); } @@ -755,12 +756,3 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckingIsTranslationException HWTEST_F(ProductHelperTest, whenQueryingMaxNumSamplersThenReturnSixteen) { EXPECT_EQ(16u, productHelper->getMaxNumSamplers()); } - -HWTEST_F(ProductHelperTest, givenProductHelperWhenGetAndOverrideHwIpVersionThenCorrectMatchIsFound) { - DebugManagerStateRestore stateRestore; - HardwareInfo hwInfo = pInHwInfo; - uint32_t config = 0x1234; - DebugManager.flags.OverrideHwIpVersion.set(config); - hwInfo.ipVersion.value = config; - EXPECT_EQ(productHelper->getHwIpVersion(hwInfo), config); -} diff --git a/shared/test/unit_test/os_interface/product_helper_tests.h b/shared/test/unit_test/os_interface/product_helper_tests.h index ebd140574b..26caa4d1d6 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.h +++ b/shared/test/unit_test/os_interface/product_helper_tests.h @@ -14,6 +14,7 @@ namespace NEO { class ExecutionEnvironment; +class CompilerProductHelper; class ProductHelper; class ReleaseHelper; } // namespace NEO @@ -30,6 +31,7 @@ struct ProductHelperTest : public ::testing::Test { HardwareInfo pInHwInfo{}; HardwareInfo outHwInfo{}; ProductHelper *productHelper = nullptr; + CompilerProductHelper *compilerProductHelper = nullptr; ReleaseHelper *releaseHelper = nullptr; PLATFORM *testPlatform = nullptr; }; diff --git a/shared/test/unit_test/os_interface/windows/wddm_additional_apater_info_options_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_additional_apater_info_options_tests.cpp index 38cae947de..11da48fb15 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_additional_apater_info_options_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_additional_apater_info_options_tests.cpp @@ -6,8 +6,8 @@ */ #include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/product_helper.h" #include "shared/test/common/os_interface/windows/wddm_fixture.h" #include "shared/test/common/test_macros/hw_test.h" @@ -15,9 +15,9 @@ using namespace NEO; TEST_F(WddmTest, WhenPopulateIpVersionWddmIsCalledThenIpVersionIsSet) { - auto &productHelper = wddm->rootDeviceEnvironment.getHelper(); + auto &compilerProductHelper = wddm->rootDeviceEnvironment.getHelper(); HardwareInfo hwInfo = *defaultHwInfo; - auto config = productHelper.getHwIpVersion(hwInfo); + auto config = compilerProductHelper.getHwIpVersion(hwInfo); wddm->populateIpVersion(hwInfo); EXPECT_EQ(config, hwInfo.ipVersion.value); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/product_config_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/product_config_tests_pvc.cpp index 0eed4f335e..d99340233f 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/product_config_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/product_config_tests_pvc.cpp @@ -21,15 +21,27 @@ PVCTEST_F(ProductConfigTests, givenPvcXlDeviceIdWhenDifferentRevisionIsPassedThe hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = 0x0; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XL_A0); hwInfo.platform.usRevId = 0x1; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XL_A0P); hwInfo.platform.usRevId = 0x6; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XL_A0P); + + hwInfo.platform.usRevId = 0x10; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XL_A0); + + hwInfo.platform.usRevId = 0x11; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XL_A0P); + + hwInfo.platform.usRevId = 0x16; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XL_A0P); } } @@ -39,37 +51,83 @@ PVCTEST_F(ProductConfigTests, givenPvcXtDeviceIdWhenDifferentRevisionIsPassedThe hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = 0x3; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XT_A0); hwInfo.platform.usRevId = 0x5; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XT_B0); hwInfo.platform.usRevId = 0x6; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XT_B1); hwInfo.platform.usRevId = 0x7; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XT_C0); + + hwInfo.platform.usRevId = 0x13; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XT_A0); + + hwInfo.platform.usRevId = 0x15; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XT_B0); + + hwInfo.platform.usRevId = 0x16; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XT_B1); + + hwInfo.platform.usRevId = 0x17; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XT_C0); } } PVCTEST_F(ProductConfigTests, givenDefaultDeviceAndRevisionIdWhenGetProductConfigThenPvcXtC0ConfigIsReturned) { - hwInfo.platform.usRevId = 0x0; - hwInfo.platform.usDeviceID = 0x0; + hwInfo.platform.usRevId = 0; + hwInfo.platform.usDeviceID = defaultHwInfo->platform.usDeviceID; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::PVC_XT_C0); } -PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdWhenGetProductConfigThenUnknownIsaIsReturned) { - hwInfo.platform.usRevId = 0x2; - productConfig = productHelper->getHwIpVersion(hwInfo); +PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdForPvcXtWhenGetProductConfigThenLatestPvcXtIsReturned) { + for (const auto &deviceId : pvcXtDeviceIds) { + hwInfo.platform.usDeviceID = deviceId; + + hwInfo.platform.usRevId = 0x2; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XT_C0); + + hwInfo.platform.usRevId = 0x4; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XT_C0); + } +} + +PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdForPvcXlWhenGetProductConfigThenLatestPvcXlIsReturned) { + for (const auto &deviceId : pvcXlDeviceIds) { + hwInfo.platform.usDeviceID = deviceId; + + hwInfo.platform.usRevId = 0x2; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XL_A0P); + + hwInfo.platform.usRevId = 0x4; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); + EXPECT_EQ(productConfig, AOT::PVC_XL_A0P); + } +} + +PVCTEST_F(ProductConfigTests, givenInvalidDeviceIdWhenGetProductConfigThenInvalidConfigIsReturned) { + hwInfo.platform.usDeviceID = 0; + + hwInfo.platform.usRevId = 0x0; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); - hwInfo.platform.usRevId = 0x4; - productConfig = productHelper->getHwIpVersion(hwInfo); + hwInfo.platform.usRevId = 0x3; + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); } diff --git a/shared/test/unit_test/xe_hpg_core/dg2/product_config_helper_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/product_config_helper_tests_dg2.cpp index aff7328ae1..6c0c801d60 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/product_config_helper_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/product_config_helper_tests_dg2.cpp @@ -279,7 +279,7 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2G10A0OrA1SteppingWhenAskingIfWAIsRequire for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) { hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(revision, hwInfo); hwInfo.platform.usDeviceID = deviceId; - hwInfo.ipVersion.value = productHelper->getHwIpVersion(hwInfo); + hwInfo.ipVersion.value = compilerProductHelper->getHwIpVersion(hwInfo); if (hwInfo.ipVersion.value == AOT::UNKNOWN_ISA) { continue; } @@ -733,7 +733,7 @@ DG2TEST_F(ProductConfigTests, givenInvalidRevisionIdWhenDeviceIdIsDefaultThenUnk hwInfo.platform.usDeviceID = 0; hwInfo.platform.usRevId = CommonConstants::invalidRevisionID; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); } @@ -742,19 +742,19 @@ DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdWhenDifferentRevisionIsPassedTh hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = 0x0; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G10_A0); hwInfo.platform.usRevId = 0x1; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G10_A1); hwInfo.platform.usRevId = 0x4; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G10_B0); hwInfo.platform.usRevId = 0x8; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G10_C0); } } @@ -764,7 +764,7 @@ DG2TEST_F(ProductConfigTests, givenDg2DeviceIdWhenIncorrectRevisionIsPassedThenC for (const auto &deviceId : *dg2) { hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = CommonConstants::invalidRevisionID; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); } } @@ -775,15 +775,15 @@ DG2TEST_F(ProductConfigTests, givenDg2G11DeviceIdWhenDifferentRevisionIsPassedTh hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = 0x0; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G11_A0); hwInfo.platform.usRevId = 0x4; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G11_B0); hwInfo.platform.usRevId = 0x5; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G11_B1); } } @@ -791,7 +791,7 @@ DG2TEST_F(ProductConfigTests, givenDg2G11DeviceIdWhenDifferentRevisionIsPassedTh DG2TEST_F(ProductConfigTests, givenDg2G12DeviceIdWhenGetProductConfigThenCorrectConfigIsReturned) { for (const auto &deviceId : dg2G12DeviceIds) { hwInfo.platform.usDeviceID = deviceId; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::DG2_G12_A0); } } @@ -800,7 +800,7 @@ DG2TEST_F(ProductConfigTests, givenNotSetDeviceAndRevisionIdWhenGetProductConfig hwInfo.platform.usRevId = 0x0; hwInfo.platform.usDeviceID = 0x0; - productConfig = productHelper->getHwIpVersion(hwInfo); + productConfig = compilerProductHelper->getHwIpVersion(hwInfo); EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); } diff --git a/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dg2.cpp index a56d7a3ebe..041a57d370 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/test_encode_dg2.cpp @@ -8,6 +8,7 @@ #include "shared/source/command_container/command_encoder.h" #include "shared/source/command_stream/linear_stream.h" #include "shared/source/command_stream/stream_properties.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/kernel/kernel_descriptor.h" #include "shared/source/release_helper/release_helper.h" #include "shared/source/xe_hpg_core/hw_cmds_dg2.h" @@ -63,6 +64,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgramComputeWalkerThenApplyL3WAForDg2G10A0 auto walkerCmd = FamilyType::cmdInitGpgpuWalker; MockExecutionEnvironment executionEnvironment{}; auto &productHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper(); + auto &compilerProductHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper(); auto &rootDeviceEnvironment = *executionEnvironment.rootDeviceEnvironments[0]; auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); @@ -72,7 +74,7 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgramComputeWalkerThenApplyL3WAForDg2G10A0 for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) { hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo); hwInfo.platform.usDeviceID = deviceId; - hwInfo.ipVersion = productHelper.getHwIpVersion(hwInfo); + hwInfo.ipVersion = compilerProductHelper.getHwIpVersion(hwInfo); if (hwInfo.ipVersion.value == AOT::UNKNOWN_ISA) { continue;