diff --git a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp index fe13b0cc37..4a1d59dffe 100644 --- a/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp +++ b/opencl/test/unit_test/offline_compiler/offline_compiler_tests.cpp @@ -673,8 +673,16 @@ TEST_F(MockOfflineCompilerTests, givenDeprecatedAcronymsWithRevisionWhenInitHwIn mockOfflineCompiler.deviceName = acronym.str(); mockOfflineCompiler.revisionId = 0x3; EXPECT_EQ(OclocErrorCode::SUCCESS, mockOfflineCompiler.initHardwareInfo(mockOfflineCompiler.deviceName)); + + auto defaultIpVersion = mockOfflineCompiler.compilerProductHelper->getDefaultHwIpVersion(); + auto productConfig = mockOfflineCompiler.compilerProductHelper->matchRevisionIdWithProductConfig(defaultIpVersion, mockOfflineCompiler.revisionId); + if (mockOfflineCompiler.argHelper->productConfigHelper->isSupportedProductConfig(productConfig)) { + EXPECT_EQ(mockOfflineCompiler.hwInfo.ipVersion.value, productConfig); + } else { + EXPECT_EQ(mockOfflineCompiler.hwInfo.ipVersion.value, defaultIpVersion); + } + EXPECT_EQ(mockOfflineCompiler.revisionId, static_cast(mockOfflineCompiler.hwInfo.platform.usRevId)); - EXPECT_EQ(mockOfflineCompiler.revisionId, static_cast(mockOfflineCompiler.hwInfo.ipVersion.revision)); } } diff --git a/opencl/test/unit_test/offline_compiler/xe_hpg_core/dg2/offline_compiler_tests_dg2.cpp b/opencl/test/unit_test/offline_compiler/xe_hpg_core/dg2/offline_compiler_tests_dg2.cpp index 80f4bb4f33..81093289cb 100644 --- a/opencl/test/unit_test/offline_compiler/xe_hpg_core/dg2/offline_compiler_tests_dg2.cpp +++ b/opencl/test/unit_test/offline_compiler/xe_hpg_core/dg2/offline_compiler_tests_dg2.cpp @@ -130,4 +130,34 @@ TEST_F(Dg2OfflineCompilerTests, givenDg2G10DeviceAndUnknownRevisionIdValueWhenIn EXPECT_EQ(mockOfflineCompiler.deviceConfig, dg2G10Config); } +DG2TEST_F(Dg2OfflineCompilerTests, givenDg2DeprecatedAcronymAndRevisionIdValueWhenInitHwInfoThenCorrectValuesAreSet) { + MockOfflineCompiler mockOfflineCompiler; + std::vector> dg2G10Configs = { + {AOT::DG2_G10_A0, REV_ID_A0}, + {AOT::DG2_G10_A1, REV_ID_A1}, + {AOT::DG2_G10_B0, REV_ID_B0}, + {AOT::DG2_G10_C0, REV_ID_C0}}; + + std::string deprecatedAcronym = NEO::hardwarePrefix[IGFX_DG2]; + + for (const auto &[config, revisionID] : dg2G10Configs) { + mockOfflineCompiler.revisionId = revisionID; + mockOfflineCompiler.initHardwareInfo(deprecatedAcronym); + + EXPECT_EQ(mockOfflineCompiler.hwInfo.platform.usRevId, revisionID); + EXPECT_EQ(mockOfflineCompiler.hwInfo.ipVersion.value, config.value); + } +} + +DG2TEST_F(Dg2OfflineCompilerTests, givenDg2DeprecatedAcronymAndInvalisRevisionIdValueWhenInitHwInfoThenCorrectValuesAreSet) { + MockOfflineCompiler mockOfflineCompiler; + std::string deprecatedAcronym = NEO::hardwarePrefix[IGFX_DG2]; + + mockOfflineCompiler.revisionId = CommonConstants::invalidRevisionID; + mockOfflineCompiler.initHardwareInfo(deprecatedAcronym); + + EXPECT_EQ(mockOfflineCompiler.hwInfo.platform.usRevId, CommonConstants::invalidRevisionID); + EXPECT_EQ(mockOfflineCompiler.hwInfo.ipVersion.value, AOT::DG2_G10_A0); +} + } // namespace NEO \ No newline at end of file diff --git a/shared/offline_compiler/source/offline_compiler.cpp b/shared/offline_compiler/source/offline_compiler.cpp index a0ba9e5016..48f2c96f90 100644 --- a/shared/offline_compiler/source/offline_compiler.cpp +++ b/shared/offline_compiler/source/offline_compiler.cpp @@ -443,9 +443,12 @@ int OfflineCompiler::initHardwareInfoForDeprecatedAcronyms(std::string deviceNam hwInfo = *hardwareInfoTable[product]; if (revisionId != -1) { hwInfo.platform.usRevId = revisionId; - hwInfo.ipVersion.revision = revisionId; } compilerProductHelper = NEO::CompilerProductHelper::create(hwInfo.platform.eProductFamily); + auto defaultIpVersion = compilerProductHelper->getDefaultHwIpVersion(); + auto productConfig = compilerProductHelper->matchRevisionIdWithProductConfig(defaultIpVersion, revisionId); + hwInfo.ipVersion = argHelper->productConfigHelper->isSupportedProductConfig(productConfig) ? productConfig : defaultIpVersion; + uint64_t config = hwInfoConfig ? hwInfoConfig : compilerProductHelper->getHwInfoConfig(hwInfo); setHwInfoValuesFromConfig(config, hwInfo); hardwareInfoBaseSetup[hwInfo.platform.eProductFamily](&hwInfo, true, *compilerProductHelper); diff --git a/shared/source/enable_cores.cmake b/shared/source/enable_cores.cmake index d596722b2e..0b30bebb80 100644 --- a/shared/source/enable_cores.cmake +++ b/shared/source/enable_cores.cmake @@ -101,6 +101,10 @@ macro(macro_for_each_platform) if(EXISTS ${SRC_FILE}) list(APPEND ${CORE_TYPE}_SRC_LINK_BASE ${SRC_FILE}) endif() + set(SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR}${CORE_TYPE_LOWER}/compiler_product_helper_${PLATFORM_IT_LOWER}_base.inl) + if(EXISTS ${SRC_FILE}) + list(APPEND ${CORE_TYPE}_SRC_LINK_BASE ${SRC_FILE}) + endif() set(SRC_FILE ${PATH_TO_CORE}enable_compiler_product_helper_${PLATFORM_IT_LOWER}.cpp) if(EXISTS ${SRC_FILE}) list(APPEND ${CORE_TYPE}_SRC_LINK_BASE ${SRC_FILE}) diff --git a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp index 94a4663f5d..2c81286471 100644 --- a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp @@ -14,6 +14,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" @@ -24,7 +25,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardwa } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::EHL; } diff --git a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp index 3c25677af2..55c89f309d 100644 --- a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp @@ -14,6 +14,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" @@ -24,7 +25,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardwar } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::ICL; } diff --git a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp index 4afbb83190..f3d9b42e56 100644 --- a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp @@ -14,6 +14,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" @@ -24,7 +25,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardware } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::LKF; } diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp index ba1e37adf6..0b93d83257 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp @@ -13,15 +13,15 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #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 { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::ADL_N; } diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp index bd94a9a3b2..97e51066f2 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp @@ -13,15 +13,15 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #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 { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::ADL_P; } diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp index 5e843373fa..306b5e6ac4 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "platforms.h" @@ -24,7 +25,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardwa } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::ADL_S; } diff --git a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp index c980739040..abaa5da383 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "platforms.h" @@ -24,7 +25,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo & } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::DG1; } diff --git a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp index 06e14dfdcb..be81ce378a 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "platforms.h" @@ -29,7 +30,7 @@ bool CompilerProductHelperHw::isForceEmuInt32DivRemSPRequired() } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::RKL; } diff --git a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp index fb1b3f20b8..fe2175d6a4 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp @@ -13,6 +13,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "shared/source/helpers/compiler_product_helper_tgllp_and_later.inl" #include "platforms.h" @@ -24,7 +25,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardw } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::TGL; } diff --git a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp index da2c6e8f8e..c83c6c3683 100644 --- a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp +++ b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp @@ -14,12 +14,13 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" namespace NEO { template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::BDW; } diff --git a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp index fe8011d17c..ce532f93a7 100644 --- a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp @@ -14,6 +14,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" @@ -30,7 +31,7 @@ uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::APL; } diff --git a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp index 19ce90e49a..df67eb3d30 100644 --- a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp @@ -26,6 +26,11 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardwar return 0x100030006; } +template <> +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { + return AOT::CFL; +} + template <> uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { auto deviceId = hwInfo.platform.usDeviceID; @@ -40,7 +45,7 @@ uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(co } else if (isWhl) { return AOT::WHL; } - return AOT::UNKNOWN_ISA; + return getDefaultHwIpVersion(); } static EnableCompilerProductHelper enableCompilerProductHelperCFL; diff --git a/shared/source/gen9/enable_compiler_product_helper_glk.cpp b/shared/source/gen9/enable_compiler_product_helper_glk.cpp index 07838711d2..f61bdc20de 100644 --- a/shared/source/gen9/enable_compiler_product_helper_glk.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_glk.cpp @@ -14,6 +14,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" @@ -29,7 +30,7 @@ uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::GLK; } diff --git a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp index 7e548666dc..dc0891490a 100644 --- a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp @@ -26,6 +26,11 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareI return 0x100030006; } +template <> +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { + return AOT::KBL; +} + template <> uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { auto deviceId = hwInfo.platform.usDeviceID; @@ -37,7 +42,7 @@ uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(cons } else if (isAml) { return AOT::AML; } - return AOT::UNKNOWN_ISA; + return getDefaultHwIpVersion(); } static EnableCompilerProductHelper enableCompilerProductHelperKBL; diff --git a/shared/source/gen9/enable_compiler_product_helper_skl.cpp b/shared/source/gen9/enable_compiler_product_helper_skl.cpp index 5ce7cb83cb..dda45c7992 100644 --- a/shared/source/gen9/enable_compiler_product_helper_skl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_skl.cpp @@ -14,6 +14,7 @@ #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #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 "shared/source/helpers/compiler_product_helper_product_config_default.inl" #include "platforms.h" @@ -25,7 +26,7 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareIn } template <> -uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { return AOT::SKL; } diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index a6cfc493cb..d23c1fae0c 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -50,6 +50,7 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_disable_subgroup_local_block_io.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_enable_split_matrix_multiply_accumulate.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_enable_subgroup_local_block_io.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_product_config_default.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_tgllp_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_xe_hp_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_xe_hpc_and_later.inl diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 68512b48eb..b878608db6 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -51,6 +51,7 @@ class CompilerProductHelper { virtual void setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const = 0; virtual const char *getCachingPolicyOptions(bool isDebuggerActive) const = 0; virtual uint64_t getHwInfoConfig(const HardwareInfo &hwInfo) const = 0; + virtual uint32_t getDefaultHwIpVersion() const = 0; virtual uint32_t getNumThreadsPerEu() const = 0; virtual uint32_t matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const = 0; virtual std::string getDeviceExtensions(const HardwareInfo &hwInfo, const ReleaseHelper *releaseHelper) const = 0; @@ -88,6 +89,7 @@ class CompilerProductHelperHw : public CompilerProductHelper { void setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const override; const char *getCachingPolicyOptions(bool isDebuggerActive) const override; uint64_t getHwInfoConfig(const HardwareInfo &hwInfo) const override; + uint32_t getDefaultHwIpVersion() const override; uint32_t getNumThreadsPerEu() const override; uint32_t matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const override; std::string getDeviceExtensions(const HardwareInfo &hwInfo, const ReleaseHelper *releaseHelper) const override; diff --git a/shared/source/helpers/compiler_product_helper_mtl_and_later.inl b/shared/source/helpers/compiler_product_helper_mtl_and_later.inl index 69fe11c481..e36df4641f 100644 --- a/shared/source/helpers/compiler_product_helper_mtl_and_later.inl +++ b/shared/source/helpers/compiler_product_helper_mtl_and_later.inl @@ -11,10 +11,11 @@ namespace NEO { template uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { - return hwInfo.ipVersion.value; + return hwInfo.ipVersion.value ? hwInfo.ipVersion.value : getDefaultHwIpVersion(); } template void CompilerProductHelperHw::setProductConfigForHwInfo(HardwareInfo &hwInfo, HardwareIpVersion config) const { hwInfo.ipVersion = config; } + } // namespace NEO diff --git a/shared/source/helpers/compiler_product_helper_product_config_default.inl b/shared/source/helpers/compiler_product_helper_product_config_default.inl new file mode 100644 index 0000000000..aca77a7f58 --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_product_config_default.inl @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { + return getDefaultHwIpVersion(); +} +} // 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 2e541b9043..2a4933bb04 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 @@ -20,6 +20,10 @@ #include "compiler_product_helper_pvc.inl" #include "platforms.h" namespace NEO { +template <> +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { + return AOT::PVC_XT_C0; +} template <> uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { @@ -47,7 +51,7 @@ uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const Har return AOT::PVC_XT_C0; } } - return AOT::UNKNOWN_ISA; + return getDefaultHwIpVersion(); } template <> uint32_t CompilerProductHelperHw::matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const { 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 d78ff0bb5d..3f6ccc2e38 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 @@ -5,19 +5,9 @@ * */ -#include "shared/source/xe_hpg_core/hw_cmds_dg2.h" - -#include "platforms.h" +#include "shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2_base.inl" namespace NEO { -template <> -uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { - if (DG2::isG10(hwInfo)) { - return 0x800040010; - } - return 0x200040010; -} - template <> uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { if (DG2::isG10(hwInfo)) { @@ -43,6 +33,6 @@ uint32_t CompilerProductHelperHw::getProductConfigFromHwInfo(const Har } else if (DG2::isG12(hwInfo)) { return AOT::DG2_G12_A0; } - return AOT::UNKNOWN_ISA; + return getDefaultHwIpVersion(); } } // namespace NEO diff --git a/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2_base.inl b/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2_base.inl new file mode 100644 index 0000000000..b7e9f51e75 --- /dev/null +++ b/shared/source/xe_hpg_core/definitions/compiler_product_helper_dg2_base.inl @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/xe_hpg_core/hw_cmds_dg2.h" + +#include "platforms.h" + +namespace NEO { +template <> +uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareInfo &hwInfo) const { + if (DG2::isG10(hwInfo)) { + return 0x800040010; + } + return 0x200040010; +} + +template <> +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { + return AOT::DG2_G10_A0; +} + +template <> +uint32_t CompilerProductHelperHw::matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const { + HardwareIpVersion dg2Config = ipVersion; + dg2Config.revision = revisionID; + return dg2Config.value; +} +} // namespace NEO diff --git a/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp b/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp index e23f016100..f609ee2c5b 100644 --- a/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp +++ b/shared/source/xe_hpg_core/enable_compiler_product_helper_dg2.cpp @@ -16,15 +16,7 @@ #include "shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl" #include "compiler_product_helper_dg2.inl" + namespace NEO { - static EnableCompilerProductHelper enableCompilerProductHelperDG2; - -template <> -uint32_t CompilerProductHelperHw::matchRevisionIdWithProductConfig(HardwareIpVersion ipVersion, uint32_t revisionID) const { - HardwareIpVersion dg2Config = ipVersion; - dg2Config.revision = revisionID; - return dg2Config.value; -} - } // namespace NEO 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 7b952d5870..0b76af1cf0 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 @@ -16,10 +16,15 @@ #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" #include "compiler_product_helper_mtl.inl" +#include "platforms.h" constexpr auto gfxProduct = IGFX_METEORLAKE; namespace NEO { +template <> +uint32_t CompilerProductHelperHw::getDefaultHwIpVersion() const { + return AOT::MTL_M_A0; +} template <> bool CompilerProductHelperHw::isSplitMatrixMultiplyAccumulateSupported(const HardwareInfo &hwInfo) const { 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 2a83b847cb..d0d9a917f7 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 @@ -107,7 +107,13 @@ CFLTEST_F(CflProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCo } pInHwInfo.platform.usDeviceID = 0u; - EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::CFL); +} + +CFLTEST_F(CflProductHelper, givenCompilerProductHelperWhenGetIpVersionAndDeviceIdIsUnknownThenDefaultConfigIsReturned) { + pInHwInfo.platform.usDeviceID = 0u; + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::CFL); + EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::CFL); } CFLTEST_F(CflProductHelper, 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 74d3362503..d7cdcd230e 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 @@ -110,9 +110,12 @@ KBLTEST_F(KblProductHelper, givenCompilerProductHelperWhenGetProductConfigThenCo pInHwInfo.platform.usDeviceID = deviceId; EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::KBL); } +} +KBLTEST_F(KblProductHelper, givenCompilerProductHelperWhenGetIpVersionAndDeviceIdIsUnknownThenDefaultConfigIsReturned) { pInHwInfo.platform.usDeviceID = 0u; - EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::UNKNOWN_ISA); + EXPECT_EQ(compilerProductHelper->getHwIpVersion(pInHwInfo), AOT::KBL); + EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::KBL); } KBLTEST_F(KblProductHelper, givenProductHelperWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { 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 d814d2cd8a..50019a8c5d 100644 --- a/shared/test/unit_test/helpers/hw_aot_config_tests.cpp +++ b/shared/test/unit_test/helpers/hw_aot_config_tests.cpp @@ -25,10 +25,10 @@ HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenSetHwInfoGmdIdThenCorrectV EXPECT_EQ(ret, productConfig); } -HWTEST2_P(ProductConfigHwInfoTests, givenUnknownAotConfigWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) { +HWTEST2_P(ProductConfigHwInfoTests, givenUnknownAotConfigWhenGetProductConfigThenDefaultConfigIsReturned, IsAtLeastMtl) { hwInfo.ipVersion = {}; auto ret = compilerProductHelper->getHwIpVersion(hwInfo); - EXPECT_EQ(ret, AOT::UNKNOWN_ISA); + EXPECT_EQ(ret, compilerProductHelper->getDefaultHwIpVersion()); } HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenGetProductConfigThenCorrectValueIsReturned, IsAtLeastMtl) { 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 11da48fb15..df21ba2509 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 @@ -22,3 +22,13 @@ TEST_F(WddmTest, WhenPopulateIpVersionWddmIsCalledThenIpVersionIsSet) { EXPECT_EQ(config, hwInfo.ipVersion.value); } + +HWTEST2_F(WddmTest, WhenPopulateIpVersionWddmIsCalledAndIpVersionIsZeroThenDefaultValueIsSet, IsAtLeastMtl) { + auto &compilerProductHelper = wddm->rootDeviceEnvironment.getHelper(); + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.ipVersion = 0; + auto config = compilerProductHelper.getDefaultHwIpVersion(); + 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 d99340233f..a42369f7b5 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 @@ -120,14 +120,8 @@ PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdForPvcXlWhenGetProductConfig } } -PVCTEST_F(ProductConfigTests, givenInvalidDeviceIdWhenGetProductConfigThenInvalidConfigIsReturned) { +PVCTEST_F(ProductConfigTests, givenUnknownDeviceIdWhenGetProductConfigThenDefaultConfigIsReturned) { hwInfo.platform.usDeviceID = 0; - - hwInfo.platform.usRevId = 0x0; productConfig = compilerProductHelper->getHwIpVersion(hwInfo); - EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); - - hwInfo.platform.usRevId = 0x3; - productConfig = compilerProductHelper->getHwIpVersion(hwInfo); - EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); + EXPECT_EQ(productConfig, AOT::PVC_XT_C0); } 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 3e068bd7b3..7e5af6fb14 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 @@ -273,24 +273,27 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2G11OrG12WhenAskingIfMaxThreadsForWorkgro } DG2TEST_F(ProductHelperTestDg2, givenDg2G10A0OrA1SteppingWhenAskingIfWAIsRequiredThenReturnTrue) { - auto hwInfo = *defaultHwInfo; - for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) { - for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) { - hwInfo.platform.usRevId = productHelper->getHwRevIdFromStepping(revision, hwInfo); - hwInfo.platform.usDeviceID = deviceId; - hwInfo.ipVersion.value = compilerProductHelper->getHwIpVersion(hwInfo); - if (hwInfo.ipVersion.value == AOT::UNKNOWN_ISA) { - continue; - } + std::vector> dg2Configs = + {{dg2G10DeviceIds[0], REV_ID_A0}, + {dg2G10DeviceIds[0], REV_ID_A1}, + {dg2G10DeviceIds[0], REV_ID_B0}, + {dg2G10DeviceIds[0], REV_ID_C0}, + {dg2G11DeviceIds[0], REV_ID_A0}, + {dg2G11DeviceIds[0], REV_ID_B0}, + {dg2G11DeviceIds[0], REV_ID_B1}, + {dg2G12DeviceIds[0], REV_ID_A0}}; - auto expectedValue = DG2::isG10(hwInfo) && revision < REVISION_B; - refreshReleaseHelper(&hwInfo); + for (const auto &[deviceID, revisionID] : dg2Configs) { + hwInfo.platform.usRevId = revisionID; + hwInfo.platform.usDeviceID = deviceID; + hwInfo.ipVersion.value = compilerProductHelper->getHwIpVersion(hwInfo); + auto expectedValue = DG2::isG10(hwInfo) && revisionID < REV_ID_B0; + refreshReleaseHelper(&hwInfo); - EXPECT_EQ(expectedValue, productHelper->isDefaultEngineTypeAdjustmentRequired(hwInfo)); - EXPECT_EQ(expectedValue, productHelper->isAllocationSizeAdjustmentRequired(hwInfo)); - EXPECT_EQ(expectedValue, productHelper->isPrefetchDisablingRequired(releaseHelper)); - } + EXPECT_EQ(expectedValue, productHelper->isDefaultEngineTypeAdjustmentRequired(hwInfo)); + EXPECT_EQ(expectedValue, productHelper->isAllocationSizeAdjustmentRequired(hwInfo)); + EXPECT_EQ(expectedValue, productHelper->isPrefetchDisablingRequired(releaseHelper)); } } @@ -325,6 +328,24 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2G12WhenAskingForSBAWaThenReturnSuccess) } } +DG2TEST_F(ProductHelperTestDg2, givenInvalidArchitectureInIpVersionWhenRefreshReleaseHelperThenNullptrIsReturned) { + auto hwInfo = *defaultHwInfo; + hwInfo.ipVersion.value = AOT::DG2_G10_A0; + hwInfo.ipVersion.architecture = 0; + + refreshReleaseHelper(&hwInfo); + EXPECT_EQ(releaseHelper, nullptr); +} + +DG2TEST_F(ProductHelperTestDg2, givenInvalidReleaseInIpVersionWhenRefreshReleaseHelperThenNullptrIsReturned) { + auto hwInfo = *defaultHwInfo; + hwInfo.ipVersion.value = AOT::DG2_G10_A0; + hwInfo.ipVersion.release = 0; + + refreshReleaseHelper(&hwInfo); + EXPECT_EQ(releaseHelper, nullptr); +} + DG2TEST_F(ProductHelperTestDg2, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledWhenIsPipeControlPriorToNonPipelinedStateCommandsWARequiredIsCalledOnCcsThenTrueIsReturned) { DebugManagerStateRestore restorer; DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(true); @@ -729,12 +750,12 @@ DG2TEST_F(ProductConfigTests, givenDg2G12DeviceIdsWhenConfigIsCheckedThenCorrect } } -DG2TEST_F(ProductConfigTests, givenInvalidRevisionIdWhenDeviceIdIsDefaultThenUnknownIsaIsReturned) { +DG2TEST_F(ProductConfigTests, givenInvalidRevisionIdWhenDeviceIdIsDefaultThenDefaultConfigIsReturned) { hwInfo.platform.usDeviceID = 0; hwInfo.platform.usRevId = CommonConstants::invalidRevisionID; productConfig = compilerProductHelper->getHwIpVersion(hwInfo); - EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); + EXPECT_EQ(productConfig, AOT::DG2_G10_A0); } DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdWhenDifferentRevisionIsPassedThenCorrectProductConfigIsReturned) { @@ -759,13 +780,13 @@ DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdWhenDifferentRevisionIsPassedTh } } -DG2TEST_F(ProductConfigTests, givenDg2DeviceIdWhenIncorrectRevisionIsPassedThenCorrectProductConfigIsReturned) { +DG2TEST_F(ProductConfigTests, givenDg2DeviceIdWhenIncorrectRevisionIsPassedThenDefaultConfigIsReturned) { for (const auto *dg2 : {&dg2G10DeviceIds, &dg2G11DeviceIds}) { for (const auto &deviceId : *dg2) { hwInfo.platform.usDeviceID = deviceId; hwInfo.platform.usRevId = CommonConstants::invalidRevisionID; productConfig = compilerProductHelper->getHwIpVersion(hwInfo); - EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); + EXPECT_EQ(productConfig, AOT::DG2_G10_A0); } } } @@ -796,12 +817,12 @@ DG2TEST_F(ProductConfigTests, givenDg2G12DeviceIdWhenGetProductConfigThenCorrect } } -DG2TEST_F(ProductConfigTests, givenNotSetDeviceAndRevisionIdWhenGetProductConfigThenUnknownIsaIsReturned) { +DG2TEST_F(ProductConfigTests, givenNotSetDeviceAndRevisionIdWhenGetProductConfigThenDefaultConfigIsReturned) { hwInfo.platform.usRevId = 0x0; hwInfo.platform.usDeviceID = 0x0; productConfig = compilerProductHelper->getHwIpVersion(hwInfo); - EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA); + EXPECT_EQ(productConfig, AOT::DG2_G10_A0); } DG2TEST_F(ProductHelperTestDg2, givenProductHelperWhenAskedIfStorageInfoAdjustmentIsRequiredThenTrueIsReturned) { 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 041a57d370..e0aeacabd8 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 @@ -63,32 +63,35 @@ DG2TEST_F(CommandEncodeDG2Test, whenProgramComputeWalkerThenApplyL3WAForDg2G10A0 using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER; 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(); + std::vector> dg2Configs = + {{dg2G10DeviceIds[0], REV_ID_A0}, + {dg2G10DeviceIds[0], REV_ID_A1}, + {dg2G10DeviceIds[0], REV_ID_B0}, + {dg2G10DeviceIds[0], REV_ID_C0}, + {dg2G11DeviceIds[0], REV_ID_A0}, + {dg2G11DeviceIds[0], REV_ID_B0}, + {dg2G11DeviceIds[0], REV_ID_B1}, + {dg2G12DeviceIds[0], REV_ID_A0}}; + KernelDescriptor kernelDescriptor; EncodeWalkerArgs walkerArgs{KernelExecutionType::Default, true, kernelDescriptor}; - for (uint8_t revision : {REVISION_A0, REVISION_A1, REVISION_B, REVISION_C}) { - for (auto deviceId : {dg2G10DeviceIds[0], dg2G11DeviceIds[0], dg2G12DeviceIds[0]}) { - hwInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(revision, hwInfo); - hwInfo.platform.usDeviceID = deviceId; - hwInfo.ipVersion = compilerProductHelper.getHwIpVersion(hwInfo); - if (hwInfo.ipVersion.value == AOT::UNKNOWN_ISA) { - continue; - } + for (const auto &[deviceID, revisionID] : dg2Configs) { + hwInfo.platform.usRevId = revisionID; + hwInfo.platform.usDeviceID = deviceID; + hwInfo.ipVersion = compilerProductHelper.getHwIpVersion(hwInfo); + rootDeviceEnvironment.releaseHelper = ReleaseHelper::create(hwInfo.ipVersion); - rootDeviceEnvironment.releaseHelper = ReleaseHelper::create(hwInfo.ipVersion); + EncodeDispatchKernel::encodeAdditionalWalkerFields(rootDeviceEnvironment, walkerCmd, walkerArgs); - EncodeDispatchKernel::encodeAdditionalWalkerFields(rootDeviceEnvironment, walkerCmd, walkerArgs); - - if (DG2::isG10(hwInfo) && revision < REVISION_B) { - EXPECT_TRUE(walkerCmd.getL3PrefetchDisable()); - } else { - EXPECT_FALSE(walkerCmd.getL3PrefetchDisable()); - } + if (DG2::isG10(hwInfo) && revisionID < REV_ID_B0) { + EXPECT_TRUE(walkerCmd.getL3PrefetchDisable()); + } else { + EXPECT_FALSE(walkerCmd.getL3PrefetchDisable()); } } } diff --git a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp index 9253d3c4ab..c6090130a5 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp @@ -186,6 +186,16 @@ MTLTEST_F(MtlProductHelper, givenHwIpVersionWhenIsPipeControlPriorToNonPipelined } } +MTLTEST_F(MtlProductHelper, givenNoReleaseHelperWhenisPipeControlPriorToNonPipelinedStateCommandsWARequiredThenCorrectValuesAreReturned) { + auto &rootDeviceEnvironment = *this->executionEnvironment->rootDeviceEnvironments[0].get(); + auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); + ReleaseHelper *releaseHelper = nullptr; + const auto &[isBasicWARequired, isExtendedWARequired] = productHelper->isPipeControlPriorToNonPipelinedStateCommandsWARequired(hwInfo, false, releaseHelper); + + EXPECT_FALSE(isExtendedWARequired); + EXPECT_TRUE(isBasicWARequired); +} + MTLTEST_F(MtlProductHelper, givenMtlNotLpgWhenIsBFloat16ConversionSupportedIsCalledThenTrueIsReturned) { auto hwInfo = *defaultHwInfo.get(); uint32_t notLpgArchitecture = 10; @@ -299,6 +309,10 @@ MTLTEST_F(MtlProductHelper, givenVariousMtlReleasesWhenGetExtensionsIsCalledThen } } +MTLTEST_F(MtlProductHelper, givenCompilerProductHelperWhenGetDefaultHwIpVersionThenCorrectValueIsSet) { + EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), AOT::MTL_M_A0); +} + using ProductHelperTestMtl = Test; MTLTEST_F(ProductHelperTestMtl, givenPatIndexAndAllocationTypeWhenCallOverridePatIndexThenForTimestampPacketTagBufferReturnTwo) {