From c3f4074f0aaa58a8424c2d7a11c5a041e25696a3 Mon Sep 17 00:00:00 2001 From: Daria Hinz Date: Wed, 12 Apr 2023 14:02:38 +0000 Subject: [PATCH] fix: Unification of aot config with hw ip version In the case of mtl+ platforms, the returned config value should equal the hardware ip version value. This change fixes situations where some config has not been added and in this case we returned an unknown value. Signed-off-by: Daria Hinz Related-To: NEO-7738 --- level_zero/core/source/device/device_imp.cpp | 2 +- .../sources/device/test_l0_device.cpp | 2 +- .../ehl/os_agnostic_product_helper_ehl.inl | 2 +- .../os_agnostic_product_helper_icllp.inl | 2 +- .../lkf/os_agnostic_product_helper_lkf.inl | 2 +- .../adln/os_agnostic_product_helper_adln.inl | 2 +- .../adlp/os_agnostic_product_helper_adlp.inl | 2 +- .../adls/os_agnostic_product_helper_adls.inl | 2 +- .../dg1/os_agnostic_product_helper_dg1.inl | 2 +- .../rkl/os_agnostic_product_helper_rkl.inl | 2 +- .../os_agnostic_product_helper_tgllp.inl | 2 +- .../bdw/os_agnostic_product_helper_bdw.inl | 2 +- .../bxt/os_agnostic_product_helper_bxt.inl | 2 +- .../cfl/os_agnostic_product_helper_cfl.inl | 2 +- .../glk/os_agnostic_product_helper_glk.inl | 2 +- .../kbl/os_agnostic_product_helper_kbl.inl | 2 +- .../skl/os_agnostic_product_helper_skl.inl | 2 +- shared/source/os_interface/CMakeLists.txt | 4 +++ shared/source/os_interface/product_helper.h | 5 +-- .../source/os_interface/product_helper_hw.h | 2 +- .../product_helper_mtl_and_later.inl | 15 +++++++++ .../os_agnostic_product_helper_xe_hp_core.inl | 2 +- .../pvc/os_agnostic_product_helper_pvc.inl | 2 +- .../os_agnostic_product_helper_dg2_extra.inl | 2 +- .../xe_hpg_core/linux/product_helper_mtl.cpp | 1 + .../mtl/os_agnostic_product_helper_mtl.inl | 26 ---------------- .../windows/product_helper_mtl.cpp | 1 + .../test/common/mocks/mock_product_helper.cpp | 2 +- .../fixtures/product_config_fixture.h | 2 +- .../unit_test/helpers/hw_aot_config_tests.cpp | 31 ++----------------- 30 files changed, 47 insertions(+), 82 deletions(-) create mode 100644 shared/source/os_interface/product_helper_mtl_and_later.inl diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 516fd34005..3584b2f08b 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -868,7 +868,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties) ze_device_ip_version_ext_t *zeDeviceIpVersion = reinterpret_cast(extendedProperties); NEO::Device *activeDevice = getActiveDevice(); auto &productHelper = activeDevice->getProductHelper(); - zeDeviceIpVersion->ipVersion = static_cast(productHelper.getProductConfigFromHwInfo(hardwareInfo)); + zeDeviceIpVersion->ipVersion = productHelper.getProductConfigFromHwInfo(hardwareInfo); } extendedProperties = static_cast(extendedProperties->pNext); } 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 7e64cedf72..c1c1792845 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 @@ -1255,7 +1255,7 @@ TEST_F(DeviceTest, givenDeviceIpVersionWhenGetDevicePropertiesThenCorrectResultI deviceProperties.pNext = &zeDeviceIpVersion; auto &productHelper = device->getProductHelper(); - auto expectedIpVersion = static_cast(productHelper.getProductConfigFromHwInfo(device->getHwInfo())); + auto expectedIpVersion = productHelper.getProductConfigFromHwInfo(device->getHwInfo()); device->getProperties(&deviceProperties); EXPECT_NE(std::numeric_limits::max(), zeDeviceIpVersion.ipVersion); diff --git a/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl b/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl index bd15a3523f..cf0d9798be 100644 --- a/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl +++ b/shared/source/gen11/ehl/os_agnostic_product_helper_ehl.inl @@ -7,7 +7,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::EHL; } } // 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 d003e657bc..22c6d89b97 100644 --- a/shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl +++ b/shared/source/gen11/icllp/os_agnostic_product_helper_icllp.inl @@ -24,7 +24,7 @@ bool ProductHelperHw::isReturnedCmdSizeForMediaSamplerAdjustmentRequ } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::ICL; } diff --git a/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl b/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl index f1c68156d1..68de0dec0e 100644 --- a/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl +++ b/shared/source/gen11/lkf/os_agnostic_product_helper_lkf.inl @@ -7,7 +7,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::LKF; } } // namespace NEO 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 25353325dc..988b93f7fe 100644 --- a/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl +++ b/shared/source/gen12lp/adln/os_agnostic_product_helper_adln.inl @@ -18,7 +18,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::ADL_N; } 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 375a58f11a..32fd777393 100644 --- a/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl +++ b/shared/source/gen12lp/adlp/os_agnostic_product_helper_adlp.inl @@ -22,7 +22,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::ADL_P; } 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 be5b6acbfc..05f78d86f3 100644 --- a/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl +++ b/shared/source/gen12lp/adls/os_agnostic_product_helper_adls.inl @@ -22,7 +22,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::ADL_S; } 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 7ee00da6f9..aa55426a2e 100644 --- a/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl +++ b/shared/source/gen12lp/dg1/os_agnostic_product_helper_dg1.inl @@ -22,7 +22,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::DG1; } 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 e8a851edf4..76697b8a68 100644 --- a/shared/source/gen12lp/rkl/os_agnostic_product_helper_rkl.inl +++ b/shared/source/gen12lp/rkl/os_agnostic_product_helper_rkl.inl @@ -22,7 +22,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::RKL; } 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 cab804c232..cf76d495d0 100644 --- a/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl +++ b/shared/source/gen12lp/tgllp/os_agnostic_product_helper_tgllp.inl @@ -24,7 +24,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::TGL; } 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 fe3d48e8d7..1701e31706 100644 --- a/shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl +++ b/shared/source/gen8/bdw/os_agnostic_product_helper_bdw.inl @@ -9,7 +9,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::BDW; } 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 8bfc0791a8..b3ef29f295 100644 --- a/shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl +++ b/shared/source/gen9/bxt/os_agnostic_product_helper_bxt.inl @@ -9,7 +9,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::APL; } 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 8a101d639f..771a5a5787 100644 --- a/shared/source/gen9/cfl/os_agnostic_product_helper_cfl.inl +++ b/shared/source/gen9/cfl/os_agnostic_product_helper_cfl.inl @@ -14,7 +14,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +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()); 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 51377eb81d..e0a35aba75 100644 --- a/shared/source/gen9/glk/os_agnostic_product_helper_glk.inl +++ b/shared/source/gen9/glk/os_agnostic_product_helper_glk.inl @@ -9,7 +9,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::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 48ad97ca8a..b07adf73ba 100644 --- a/shared/source/gen9/kbl/os_agnostic_product_helper_kbl.inl +++ b/shared/source/gen9/kbl/os_agnostic_product_helper_kbl.inl @@ -14,7 +14,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +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()); 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 ffd086062d..fbcab9f05d 100644 --- a/shared/source/gen9/skl/os_agnostic_product_helper_skl.inl +++ b/shared/source/gen9/skl/os_agnostic_product_helper_skl.inl @@ -9,7 +9,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::SKL; } diff --git a/shared/source/os_interface/CMakeLists.txt b/shared/source/os_interface/CMakeLists.txt index d8b92ac05c..1d56806749 100644 --- a/shared/source/os_interface/CMakeLists.txt +++ b/shared/source/os_interface/CMakeLists.txt @@ -54,5 +54,9 @@ 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/product_helper.h b/shared/source/os_interface/product_helper.h index ece582a1d9..d57cea10e6 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -13,9 +13,6 @@ #include #include #include -namespace AOT { -enum PRODUCT_CONFIG : uint32_t; -} namespace aub_stream { enum class ProductFamily : uint32_t; @@ -92,7 +89,7 @@ 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 AOT::PRODUCT_CONFIG getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const = 0; + virtual uint32_t getProductConfigFromHwInfo(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; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 408fb92705..eb61a03519 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -45,7 +45,7 @@ class ProductHelperHw : public ProductHelper { bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const override; bool overrideGfxPartitionLayoutForWsl() const override; uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const override; - AOT::PRODUCT_CONFIG getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const override; + uint32_t getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const override; uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override; uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override; std::optional getAubStreamProductFamily() 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 new file mode 100644 index 0000000000..90c91baddd --- /dev/null +++ b/shared/source/os_interface/product_helper_mtl_and_later.inl @@ -0,0 +1,15 @@ +/* + * 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/xe_hp_core/os_agnostic_product_helper_xe_hp_core.inl b/shared/source/xe_hp_core/os_agnostic_product_helper_xe_hp_core.inl index a17aa79224..49ef16d6df 100644 --- a/shared/source/xe_hp_core/os_agnostic_product_helper_xe_hp_core.inl +++ b/shared/source/xe_hp_core/os_agnostic_product_helper_xe_hp_core.inl @@ -22,7 +22,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::XEHP_SDV; } 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 14c91dfc5a..5f6cbd0329 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,7 +58,7 @@ uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { uint32_t stepping = getSteppingFromHwRevId(hwInfo); if (stepping == CommonConstants::invalidStepping) { return AOT::UNKNOWN_ISA; 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 index 24513d1296..ab174547a2 100644 --- 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 @@ -7,7 +7,7 @@ namespace NEO { template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { if (DG2::isG10(hwInfo)) { switch (hwInfo.platform.usRevId) { case 0x0: 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 03592c55bc..c8d98c6ebb 100644 --- a/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/linux/product_helper_mtl.cpp @@ -10,6 +10,7 @@ #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" 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 272f56b47a..b9b14b6343 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 @@ -41,32 +41,6 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping, return CommonConstants::invalidStepping; } -template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - switch (hwInfo.ipVersion.release) { - case 70: - switch (hwInfo.ipVersion.revision) { - case 0: - return AOT::MTL_M_A0; - case 4: - return AOT::MTL_M_B0; - default: - return AOT::UNKNOWN_ISA; - } - case 71: - switch (hwInfo.ipVersion.revision) { - case 0: - return AOT::MTL_P_A0; - case 4: - return AOT::MTL_P_B0; - default: - return AOT::UNKNOWN_ISA; - } - default: - return AOT::UNKNOWN_ISA; - } -} - template <> uint32_t ProductHelperHw::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const { switch (hwInfo.platform.usRevId) { 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 42718a4361..54c546eeb7 100644 --- a/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp +++ b/shared/source/xe_hpg_core/windows/product_helper_mtl.cpp @@ -9,6 +9,7 @@ #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" diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index 0f829e19d6..7f4a7ab4f7 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -120,7 +120,7 @@ uint32_t ProductHelperHw::getHwRevIdFromStepping(uint32_t stepping } template <> -AOT::PRODUCT_CONFIG ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t ProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::UNKNOWN_ISA; } diff --git a/shared/test/unit_test/fixtures/product_config_fixture.h b/shared/test/unit_test/fixtures/product_config_fixture.h index 84072c5f21..a9f8e17763 100644 --- a/shared/test/unit_test/fixtures/product_config_fixture.h +++ b/shared/test/unit_test/fixtures/product_config_fixture.h @@ -29,7 +29,7 @@ struct ProductConfigTest : public T { std::unique_ptr productHelper = nullptr; NEO::HardwareInfo hwInfo = {}; - AOT::PRODUCT_CONFIG productConfig = AOT::UNKNOWN_ISA; + uint32_t productConfig = AOT::UNKNOWN_ISA; }; struct ProductConfigHwInfoTests : public ProductConfigTest<::testing::TestWithParam>> { 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 ebd0732f4d..6fb3c7ae05 100644 --- a/shared/test/unit_test/helpers/hw_aot_config_tests.cpp +++ b/shared/test/unit_test/helpers/hw_aot_config_tests.cpp @@ -12,46 +12,19 @@ using namespace NEO; -HWTEST2_P(ProductConfigHwInfoBadArchTests, givenAotConfigWithIncorrectArchWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) { - HardwareIpVersion aotConfig = {0}; - aotConfig.value = productConfig; - hwInfo.ipVersion.architecture = invalidConfig.architecture; - hwInfo.ipVersion.release = aotConfig.release; - hwInfo.ipVersion.revision = aotConfig.revision; - auto ret = productHelper->getProductConfigFromHwInfo(hwInfo); - EXPECT_EQ(ret, AOT::UNKNOWN_ISA); -} - -HWTEST2_P(ProductConfigHwInfoBadRevisionTests, givenAotConfigWithIncorrectRevisionIdWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) { - HardwareIpVersion aotConfig = {0}; - aotConfig.value = productConfig; - hwInfo.ipVersion.architecture = aotConfig.architecture; - hwInfo.ipVersion.release = aotConfig.release; - hwInfo.ipVersion.revision = invalidConfig.revision; - auto ret = productHelper->getProductConfigFromHwInfo(hwInfo); - EXPECT_EQ(ret, AOT::UNKNOWN_ISA); -} - HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenSetHwInfoGmdIdThenCorrectValueIsSet, IsAtLeastMtl) { HardwareIpVersion aotConfig = {0}; aotConfig.value = productConfig; MockExecutionEnvironment mockExecutionEnvironment{}; auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); 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); -} - -HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWithIncorrectReleaseWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) { - HardwareIpVersion aotConfig = {0}; - aotConfig.value = productConfig; - hwInfo.ipVersion.architecture = aotConfig.architecture; - hwInfo.ipVersion.release = invalidConfig.release; - hwInfo.ipVersion.revision = aotConfig.revision; auto ret = productHelper->getProductConfigFromHwInfo(hwInfo); - EXPECT_EQ(ret, AOT::UNKNOWN_ISA); + EXPECT_EQ(ret, productConfig); } HWTEST2_P(ProductConfigHwInfoTests, givenUnknownAotConfigWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) {