From 553dd7f21f454045c287f76d35a9fff07e8151ee Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 8 Mar 2023 09:30:38 +0000 Subject: [PATCH] refactor: return thread per eu from compiler product helper Related-To: NEO-7442 Signed-off-by: Mateusz Jablonski --- .../fixtures/multicontext_aub_fixture.cpp | 9 ++- .../sync_buffer_handler_tests.cpp | 4 +- .../source/ocloc_arg_helper.cpp | 2 +- .../source/offline_compiler.cpp | 2 +- .../source/offline_linker.cpp | 2 +- .../enable_compiler_product_helper_ehl.cpp | 1 + .../enable_compiler_product_helper_icllp.cpp | 1 + .../enable_compiler_product_helper_lkf.cpp | 1 + shared/source/gen11/hw_cmds_ehl.h | 7 +- shared/source/gen11/hw_cmds_icllp.h | 11 ++- shared/source/gen11/hw_cmds_lkf.h | 7 +- shared/source/gen11/hw_info_ehl.cpp | 15 ++-- shared/source/gen11/hw_info_icllp.cpp | 29 +++---- shared/source/gen11/hw_info_lkf.cpp | 19 +++-- .../definitions/hw_info_setup_adln.inl | 6 +- .../definitions/hw_info_setup_adlp.inl | 6 +- .../enable_compiler_product_helper_adln.cpp | 1 + .../enable_compiler_product_helper_adlp.cpp | 1 + .../enable_compiler_product_helper_adls.cpp | 1 + .../enable_compiler_product_helper_dg1.cpp | 1 + .../enable_compiler_product_helper_rkl.cpp | 1 + .../enable_compiler_product_helper_tgllp.cpp | 1 + shared/source/gen12lp/hw_cmds_adln.h | 7 +- shared/source/gen12lp/hw_cmds_adlp.h | 7 +- shared/source/gen12lp/hw_cmds_adls.h | 7 +- shared/source/gen12lp/hw_cmds_dg1.h | 7 +- shared/source/gen12lp/hw_cmds_rkl.h | 7 +- shared/source/gen12lp/hw_cmds_tgllp.h | 9 +-- shared/source/gen12lp/hw_info_adln.cpp | 9 ++- shared/source/gen12lp/hw_info_adlp.cpp | 7 +- shared/source/gen12lp/hw_info_adls.cpp | 15 ++-- shared/source/gen12lp/hw_info_dg1.cpp | 17 ++-- shared/source/gen12lp/hw_info_rkl.cpp | 15 ++-- shared/source/gen12lp/hw_info_tgllp.cpp | 23 +++--- .../enable_compiler_product_helper_bdw.cpp | 1 + shared/source/gen8/hw_cmds_bdw.h | 13 ++- shared/source/gen8/hw_info_bdw.cpp | 35 ++++---- .../enable_compiler_product_helper_bxt.cpp | 5 ++ .../enable_compiler_product_helper_cfl.cpp | 1 + .../enable_compiler_product_helper_glk.cpp | 5 ++ .../enable_compiler_product_helper_kbl.cpp | 1 + .../enable_compiler_product_helper_skl.cpp | 1 + shared/source/gen9/hw_cmds_bxt.h | 9 +-- shared/source/gen9/hw_cmds_cfl.h | 15 ++-- shared/source/gen9/hw_cmds_glk.h | 9 +-- shared/source/gen9/hw_cmds_kbl.h | 15 ++-- shared/source/gen9/hw_cmds_skl.h | 15 ++-- shared/source/gen9/hw_info_bxt.cpp | 23 +++--- shared/source/gen9/hw_info_cfl.cpp | 41 +++++----- shared/source/gen9/hw_info_glk.cpp | 23 +++--- shared/source/gen9/hw_info_kbl.cpp | 41 +++++----- shared/source/gen9/hw_info_skl.cpp | 41 +++++----- shared/source/helpers/CMakeLists.txt | 2 + .../source/helpers/compiler_product_helper.h | 2 + .../compiler_product_helper_before_xe_hp.inl | 18 +++++ ...ompiler_product_helper_xe_hp_and_later.inl | 18 +++++ shared/source/helpers/hw_info.cpp | 4 +- shared/source/helpers/hw_info.h | 5 +- shared/source/os_interface/device_factory.cpp | 2 +- shared/source/os_interface/hw_info_config.h | 3 - shared/source/os_interface/hw_info_config.inl | 1 + shared/source/os_interface/linux/drm_neo.cpp | 3 +- shared/source/os_interface/linux/drm_neo.h | 3 +- .../os_interface/linux/hw_info_config_drm.cpp | 5 +- .../source/os_interface/product_helper_hw.h | 9 +-- .../definitions/hw_info_setup_xehp.inl | 10 +-- ...able_compiler_product_helper_xe_hp_sdv.cpp | 1 + shared/source/xe_hp_core/hw_cmds_xe_hp_sdv.h | 7 +- .../source/xe_hp_core/hw_info_xe_hp_sdv.cpp | 6 +- .../definitions/hw_info_setup_pvc.inl | 8 +- .../enable_compiler_product_helper_pvc.cpp | 1 + shared/source/xe_hpc_core/hw_cmds_pvc.h | 7 +- shared/source/xe_hpc_core/hw_info_pvc.cpp | 9 ++- .../definitions/hw_info_setup_dg2.inl | 8 +- .../definitions/hw_info_setup_mtl.inl | 8 +- .../enable_compiler_product_helper_dg2.cpp | 1 + .../enable_compiler_product_helper_mtl.cpp | 1 + shared/source/xe_hpg_core/hw_cmds_dg2.h | 7 +- shared/source/xe_hpg_core/hw_cmds_mtl.h | 7 +- shared/source/xe_hpg_core/hw_info_dg2.cpp | 7 +- shared/source/xe_hpg_core/hw_info_mtl.cpp | 7 +- .../test/common/mocks/mock_hw_info_config.cpp | 1 + shared/test/common/tests_configuration.cpp | 6 +- ...d_stream_receiver_tests_xehp_and_later.cpp | 4 +- ...mulated_common_hw_tests_xehp_and_later.cpp | 4 +- .../command_stream/get_devices_tests.cpp | 10 ++- ...d_stream_receiver_tests_xehp_and_later.cpp | 4 +- .../unit_test/device/neo_device_tests.cpp | 7 +- .../gen11/ehl/test_product_helper_ehl.cpp | 9 ++- .../gen11/icllp/test_product_helper_icllp.cpp | 8 +- .../gen11/lkf/test_product_helper_lkf.cpp | 11 ++- .../gen12lp/adln/test_product_helper_adln.cpp | 6 +- .../adlp/linux/product_helper_tests_adlp.cpp | 79 ++----------------- .../gen12lp/adlp/test_product_helper_adlp.cpp | 6 +- .../gen12lp/adls/test_product_helper_adls.cpp | 6 +- .../gen12lp/dg1/hw_info_tests_dg1.cpp | 10 ++- .../gen12lp/dg1/test_product_helper_dg1.cpp | 7 +- .../gen12lp/rkl/test_product_helper_rkl.cpp | 3 +- .../tgllp/product_helper_tests_tgllp.cpp | 15 ++-- .../gen8/bdw/test_product_helper_bdw.cpp | 12 ++- .../gen9/bxt/test_product_helper_bxt.cpp | 8 +- .../gen9/cfl/test_product_helper_cfl.cpp | 8 +- .../gen9/glk/test_product_helper_glk.cpp | 8 +- .../gen9/kbl/test_product_helper_kbl.cpp | 10 ++- .../skl/linux/product_helper_tests_skl.cpp | 4 +- .../gen9/skl/test_product_helper_skl.cpp | 10 ++- .../linux/drm_system_info_tests.cpp | 12 +-- .../os_interface/linux/drm_tests.cpp | 2 +- .../xe_hpc_core/pvc/hw_info_tests_pvc.cpp | 7 +- .../dg2/product_config_helper_tests_dg2.cpp | 7 +- .../xe_hpg_core/mtl/hw_info_tests_mtl.cpp | 22 ++++-- .../mtl/product_helper_tests_mtl.cpp | 6 +- 112 files changed, 555 insertions(+), 479 deletions(-) create mode 100644 shared/source/helpers/compiler_product_helper_before_xe_hp.inl create mode 100644 shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl diff --git a/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp b/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp index a0f03e7228..e88c011896 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp +++ b/opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.cpp @@ -9,6 +9,7 @@ #include "shared/source/command_stream/aub_command_stream_receiver.h" #include "shared/source/helpers/api_specific_config.h" +#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/test/common/helpers/ult_hw_config.h" @@ -173,11 +174,13 @@ void MulticontextAubFixture::overridePlatformConfigForAllEnginesSupport(Hardware bool setupCalled = false; + auto compilerProductHelper = CompilerProductHelper::create(localHwInfo.platform.eProductFamily); + if (localHwInfo.platform.eRenderCoreFamily == IGFX_XE_HP_CORE) { #ifdef SUPPORT_XE_HP_SDV if (localHwInfo.platform.eProductFamily == IGFX_XE_HP_SDV) { setupCalled = true; - XehpSdvHwConfig::setupHardwareInfo(&localHwInfo, true); + XehpSdvHwConfig::setupHardwareInfo(&localHwInfo, true, *compilerProductHelper); // Mock values localHwInfo.gtSystemInfo.SliceCount = 8; @@ -197,7 +200,7 @@ void MulticontextAubFixture::overridePlatformConfigForAllEnginesSupport(Hardware ASSERT_TRUE(numberOfEnabledTiles == 1); setupCalled = true; - Dg2HwConfig::setupHardwareInfo(&localHwInfo, true); + Dg2HwConfig::setupHardwareInfo(&localHwInfo, true, *compilerProductHelper); // Mock values localHwInfo.gtSystemInfo.SliceCount = 8; @@ -216,7 +219,7 @@ void MulticontextAubFixture::overridePlatformConfigForAllEnginesSupport(Hardware if (localHwInfo.platform.eProductFamily == IGFX_PVC) { setupCalled = true; - PvcHwConfig::setupHardwareInfo(&localHwInfo, true); + PvcHwConfig::setupHardwareInfo(&localHwInfo, true, *compilerProductHelper); // Mock values localHwInfo.gtSystemInfo.SliceCount = 8; diff --git a/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp b/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp index 62f59178c8..203574c903 100644 --- a/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp +++ b/opencl/test/unit_test/command_queue/sync_buffer_handler_tests.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/program/sync_buffer_handler.h" #include "shared/test/common/mocks/ult_device_factory.h" @@ -33,7 +34,8 @@ class SyncBufferEnqueueHandlerTest : public EnqueueHandlerTest { void SetUp() override { hardwareInfo = *defaultHwInfo; hardwareInfo.capabilityTable.blitterOperationsSupported = true; - hardwareInfoSetup[productFamily](&hardwareInfo, true, 0); + auto compilerProductHelper = CompilerProductHelper::create(hardwareInfo.platform.eProductFamily); + hardwareInfoSetup[productFamily](&hardwareInfo, true, 0, *compilerProductHelper); setUpImpl(&hardwareInfo); } diff --git a/shared/offline_compiler/source/ocloc_arg_helper.cpp b/shared/offline_compiler/source/ocloc_arg_helper.cpp index ede7951af5..4e927984cb 100644 --- a/shared/offline_compiler/source/ocloc_arg_helper.cpp +++ b/shared/offline_compiler/source/ocloc_arg_helper.cpp @@ -175,7 +175,7 @@ bool OclocArgHelper::getHwInfoForProductConfig(uint32_t productConfig, NEO::Hard } uint64_t config = hwInfoConfig ? hwInfoConfig : compilerProductHelper->getHwInfoConfig(hwInfo); setHwInfoValuesFromConfig(config, hwInfo); - NEO::hardwareInfoBaseSetup[hwInfo.platform.eProductFamily](&hwInfo, true); + NEO::hardwareInfoBaseSetup[hwInfo.platform.eProductFamily](&hwInfo, true, *compilerProductHelper); retVal = true; return retVal; diff --git a/shared/offline_compiler/source/offline_compiler.cpp b/shared/offline_compiler/source/offline_compiler.cpp index d805e8a98e..d78131ab6b 100644 --- a/shared/offline_compiler/source/offline_compiler.cpp +++ b/shared/offline_compiler/source/offline_compiler.cpp @@ -440,7 +440,7 @@ int OfflineCompiler::initHardwareInfoForDeprecatedAcronyms(std::string deviceNam compilerProductHelper = NEO::CompilerProductHelper::create(hwInfo.platform.eProductFamily); uint64_t config = hwInfoConfig ? hwInfoConfig : compilerProductHelper->getHwInfoConfig(hwInfo); setHwInfoValuesFromConfig(config, hwInfo); - hardwareInfoBaseSetup[hwInfo.platform.eProductFamily](&hwInfo, true); + hardwareInfoBaseSetup[hwInfo.platform.eProductFamily](&hwInfo, true, *compilerProductHelper); UNRECOVERABLE_IF(compilerProductHelper == nullptr); productFamilyName = hardwarePrefix[hwInfo.platform.eProductFamily]; return SUCCESS; diff --git a/shared/offline_compiler/source/offline_linker.cpp b/shared/offline_compiler/source/offline_linker.cpp index 389f175010..d22469b744 100644 --- a/shared/offline_compiler/source/offline_linker.cpp +++ b/shared/offline_compiler/source/offline_linker.cpp @@ -206,7 +206,7 @@ int OfflineLinker::initHardwareInfo() { auto compilerProductHelper = NEO::CompilerProductHelper::create(hwInfo.platform.eProductFamily); const auto hwInfoConfig = compilerProductHelper->getHwInfoConfig(hwInfo); setHwInfoValuesFromConfig(hwInfoConfig, hwInfo); - hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, hwInfoConfig); + hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, hwInfoConfig, *compilerProductHelper); return OclocErrorCode::SUCCESS; } diff --git a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp index b8a493f165..457f23df33 100644 --- a/shared/source/gen11/enable_compiler_product_helper_ehl.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_ehl.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_ehl.h" diff --git a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp index ea9416e52c..8d1d807d9f 100644 --- a/shared/source/gen11/enable_compiler_product_helper_icllp.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_icllp.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_icllp.h" diff --git a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp index fee7a39f20..b78c8f11d5 100644 --- a/shared/source/gen11/enable_compiler_product_helper_lkf.cpp +++ b/shared/source/gen11/enable_compiler_product_helper_lkf.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_lkf.h" diff --git a/shared/source/gen11/hw_cmds_ehl.h b/shared/source/gen11/hw_cmds_ehl.h index 91f11ac55d..1a9949aa4d 100644 --- a/shared/source/gen11/hw_cmds_ehl.h +++ b/shared/source/gen11/hw_cmds_ehl.h @@ -16,19 +16,18 @@ struct EHL : public Gen11Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 4; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class EhlHwConfig : public EHL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen11/hw_cmds_icllp.h b/shared/source/gen11/hw_cmds_icllp.h index 3fb4fed6bb..1f4701cc95 100644 --- a/shared/source/gen11/hw_cmds_icllp.h +++ b/shared/source/gen11/hw_cmds_icllp.h @@ -16,19 +16,18 @@ struct ICLLP : public Gen11Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 8; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class IcllpHw1x8x8 : public ICLLP { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -37,7 +36,7 @@ class IcllpHw1x8x8 : public ICLLP { class IcllpHw1x4x8 : public ICLLP { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -45,7 +44,7 @@ class IcllpHw1x4x8 : public ICLLP { }; class IcllpHw1x6x8 : public ICLLP { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen11/hw_cmds_lkf.h b/shared/source/gen11/hw_cmds_lkf.h index e675b57734..de53b09c99 100644 --- a/shared/source/gen11/hw_cmds_lkf.h +++ b/shared/source/gen11/hw_cmds_lkf.h @@ -16,18 +16,17 @@ struct LKF : public Gen11Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 8; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class LkfHw1x8x8 : public LKF { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen11/hw_info_ehl.cpp b/shared/source/gen11/hw_info_ehl.cpp index da6859ddee..396461c381 100644 --- a/shared/source/gen11/hw_info_ehl.cpp +++ b/shared/source/gen11/hw_info_ehl.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen11/hw_cmds_ehl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -112,9 +113,9 @@ void EHL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void EHL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void EHL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * EHL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 0; gtSysInfo->TotalHsThreads = 0; gtSysInfo->TotalDsThreads = 0; @@ -141,8 +142,8 @@ const HardwareInfo EhlHwConfig::hwInfo = { AOT::EHL}; GT_SYSTEM_INFO EhlHwConfig::gtSystemInfo = {0}; -void EhlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - EHL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void EhlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + EHL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -153,8 +154,8 @@ void EhlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable const HardwareInfo EHL::hwInfo = EhlHwConfig::hwInfo; -void setupEHLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - EhlHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupEHLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + EhlHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*EHL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupEHLHardwareInfoImpl; +void (*EHL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupEHLHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen11/hw_info_icllp.cpp b/shared/source/gen11/hw_info_icllp.cpp index ccc4ef747e..8085ed8367 100644 --- a/shared/source/gen11/hw_info_icllp.cpp +++ b/shared/source/gen11/hw_info_icllp.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen11/hw_cmds_icllp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -112,9 +113,9 @@ void ICLLP::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void ICLLP::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void ICLLP::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * ICLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalHsThreads = 224; gtSysInfo->TotalGsThreads = 224; gtSysInfo->TotalVsThreads = 336; @@ -141,8 +142,8 @@ const HardwareInfo IcllpHw1x8x8::hwInfo = { AOT::ICL}; GT_SYSTEM_INFO IcllpHw1x8x8::gtSystemInfo = {0}; -void IcllpHw1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - ICLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void IcllpHw1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + ICLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -163,8 +164,8 @@ const HardwareInfo IcllpHw1x4x8::hwInfo = { AOT::ICL}; GT_SYSTEM_INFO IcllpHw1x4x8::gtSystemInfo = {0}; -void IcllpHw1x4x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - ICLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void IcllpHw1x4x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + ICLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -182,8 +183,8 @@ const HardwareInfo IcllpHw1x6x8::hwInfo = { AOT::ICL}; GT_SYSTEM_INFO IcllpHw1x6x8::gtSystemInfo = {0}; -void IcllpHw1x6x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - ICLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void IcllpHw1x6x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + ICLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -194,20 +195,20 @@ void IcllpHw1x6x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTabl const HardwareInfo ICLLP::hwInfo = IcllpHw1x8x8::hwInfo; -void setupICLLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupICLLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100080008) { - IcllpHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + IcllpHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100040008) { - IcllpHw1x4x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + IcllpHw1x4x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100060008) { - IcllpHw1x6x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + IcllpHw1x6x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - IcllpHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + IcllpHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*ICLLP::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupICLLPHardwareInfoImpl; +void (*ICLLP::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupICLLPHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen11/hw_info_lkf.cpp b/shared/source/gen11/hw_info_lkf.cpp index 81eaf98562..3579984e16 100644 --- a/shared/source/gen11/hw_info_lkf.cpp +++ b/shared/source/gen11/hw_info_lkf.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen11/hw_cmds_lkf.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -112,9 +113,9 @@ void LKF::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void LKF::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void LKF::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * LKF::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 448; gtSysInfo->TotalHsThreads = 448; gtSysInfo->TotalDsThreads = 448; @@ -140,11 +141,9 @@ const HardwareInfo LkfHw1x8x8::hwInfo = { LKF::capabilityTable, AOT::LKF}; GT_SYSTEM_INFO LkfHw1x8x8::gtSystemInfo = {0}; -void LkfHw1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - LKF::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); - +void LkfHw1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + LKF::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * LKF::threadsPerEu; gtSysInfo->SliceCount = 1; gtSysInfo->L3CacheSizeInKb = 2560; gtSysInfo->L3BankCount = 8; @@ -153,16 +152,16 @@ void LkfHw1x8x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo LKF::hwInfo = LkfHw1x8x8::hwInfo; -void setupLKFHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupLKFHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100080008) { - LkfHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + LkfHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - LkfHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + LkfHw1x8x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*LKF::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupLKFHardwareInfoImpl; +void (*LKF::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupLKFHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen12lp/definitions/hw_info_setup_adln.inl b/shared/source/gen12lp/definitions/hw_info_setup_adln.inl index bea3d19bae..f8b29e33f6 100644 --- a/shared/source/gen12lp/definitions/hw_info_setup_adln.inl +++ b/shared/source/gen12lp/definitions/hw_info_setup_adln.inl @@ -7,8 +7,8 @@ const HardwareInfo ADLN::hwInfo = AdlnHwConfig::hwInfo; -void setupADLNHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - AdlnHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupADLNHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + AdlnHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*ADLN::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupADLNHardwareInfoImpl; +void (*ADLN::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupADLNHardwareInfoImpl; diff --git a/shared/source/gen12lp/definitions/hw_info_setup_adlp.inl b/shared/source/gen12lp/definitions/hw_info_setup_adlp.inl index f987790c14..5463680376 100644 --- a/shared/source/gen12lp/definitions/hw_info_setup_adlp.inl +++ b/shared/source/gen12lp/definitions/hw_info_setup_adlp.inl @@ -7,8 +7,8 @@ const HardwareInfo ADLP::hwInfo = AdlpHwConfig::hwInfo; -void setupADLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - AdlpHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupADLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + AdlpHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*ADLP::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupADLPHardwareInfoImpl; +void (*ADLP::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupADLPHardwareInfoImpl; diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp index 6ba1bae54b..3eae8a3291 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adln.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "compiler_product_helper_adln.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp index d9d6954df5..aad4153b58 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adlp.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "compiler_product_helper_adlp.inl" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp index 757709d189..42e0738e63 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_adls.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_adls.h" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp index df7f996c10..f6694281ec 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_dg1.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_dg1.h" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp index 8efa26b169..4423cfb217 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_rkl.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_rkl.h" diff --git a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp index 560ae89fbb..5be0a6c0f5 100644 --- a/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp +++ b/shared/source/gen12lp/enable_compiler_product_helper_tgllp.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_tgllp.h" diff --git a/shared/source/gen12lp/hw_cmds_adln.h b/shared/source/gen12lp/hw_cmds_adln.h index 0a2526a232..888fd332dd 100644 --- a/shared/source/gen12lp/hw_cmds_adln.h +++ b/shared/source/gen12lp/hw_cmds_adln.h @@ -16,19 +16,18 @@ struct ADLN : public Gen12LpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 6; static const uint32_t maxDualSubslicesSupported = 12; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class AdlnHwConfig : public ADLN { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen12lp/hw_cmds_adlp.h b/shared/source/gen12lp/hw_cmds_adlp.h index 1da6c505d1..c6212085db 100644 --- a/shared/source/gen12lp/hw_cmds_adlp.h +++ b/shared/source/gen12lp/hw_cmds_adlp.h @@ -16,15 +16,14 @@ struct ADLP : public Gen12LpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 6; static const uint32_t maxDualSubslicesSupported = 12; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); struct PipelineSelectStateSupport { static constexpr bool mediaSamplerDopClockGate = true; @@ -34,7 +33,7 @@ struct ADLP : public Gen12LpFamily { class AdlpHwConfig : public ADLP { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen12lp/hw_cmds_adls.h b/shared/source/gen12lp/hw_cmds_adls.h index d1415c7b8e..2e9ae26290 100644 --- a/shared/source/gen12lp/hw_cmds_adls.h +++ b/shared/source/gen12lp/hw_cmds_adls.h @@ -16,19 +16,18 @@ struct ADLS : public Gen12LpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 6; static const uint32_t maxDualSubslicesSupported = 12; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class AdlsHwConfig : public ADLS { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen12lp/hw_cmds_dg1.h b/shared/source/gen12lp/hw_cmds_dg1.h index 5dfdd74f35..b69ced2e2b 100644 --- a/shared/source/gen12lp/hw_cmds_dg1.h +++ b/shared/source/gen12lp/hw_cmds_dg1.h @@ -15,19 +15,18 @@ struct DG1 : public Gen12LpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 6; static const uint32_t maxDualSubslicesSupported = 6; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class Dg1HwConfig : public DG1 { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen12lp/hw_cmds_rkl.h b/shared/source/gen12lp/hw_cmds_rkl.h index 9da9cbb7f1..3b0b33de2f 100644 --- a/shared/source/gen12lp/hw_cmds_rkl.h +++ b/shared/source/gen12lp/hw_cmds_rkl.h @@ -15,17 +15,16 @@ struct RKL : public Gen12LpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 1; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class RklHwConfig : public RKL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen12lp/hw_cmds_tgllp.h b/shared/source/gen12lp/hw_cmds_tgllp.h index 4c49a6b705..b793073d89 100644 --- a/shared/source/gen12lp/hw_cmds_tgllp.h +++ b/shared/source/gen12lp/hw_cmds_tgllp.h @@ -16,20 +16,19 @@ struct TGLLP : public Gen12LpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 6; static const uint32_t maxDualSubslicesSupported = 6; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class TgllpHw1x6x16 : public TGLLP { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -38,7 +37,7 @@ class TgllpHw1x6x16 : public TGLLP { class TgllpHw1x2x16 : public TGLLP { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen12lp/hw_info_adln.cpp b/shared/source/gen12lp/hw_info_adln.cpp index ee0a0217f9..668ce987a6 100644 --- a/shared/source/gen12lp/hw_info_adln.cpp +++ b/shared/source/gen12lp/hw_info_adln.cpp @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen12lp/hw_cmds_adln.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -114,9 +115,9 @@ void ADLN::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waUntypedBufferCompression = true; }; -void ADLN::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void ADLN::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * ADLN::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalPsThreadsWindowerRange = 64; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->MaxEuPerSubSlice = ADLN::maxEuPerSubslice; @@ -140,8 +141,8 @@ const HardwareInfo AdlnHwConfig::hwInfo = { AOT::ADL_N}; GT_SYSTEM_INFO AdlnHwConfig::gtSystemInfo = {0}; -void AdlnHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - ADLN::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void AdlnHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + ADLN::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->L3CacheSizeInKb = 1920; diff --git a/shared/source/gen12lp/hw_info_adlp.cpp b/shared/source/gen12lp/hw_info_adlp.cpp index 436a543a66..35647d00ee 100644 --- a/shared/source/gen12lp/hw_info_adlp.cpp +++ b/shared/source/gen12lp/hw_info_adlp.cpp @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen12lp/hw_cmds_adlp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -114,9 +115,9 @@ void ADLP::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waUntypedBufferCompression = true; }; -void ADLP::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void ADLP::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * ADLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalPsThreadsWindowerRange = 64; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->MaxEuPerSubSlice = ADLP::maxEuPerSubslice; @@ -140,7 +141,7 @@ const HardwareInfo AdlpHwConfig::hwInfo = { AOT::ADL_P}; GT_SYSTEM_INFO AdlpHwConfig::gtSystemInfo = {0}; -void AdlpHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void AdlpHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->IsDynamicallyPopulated = false; diff --git a/shared/source/gen12lp/hw_info_adls.cpp b/shared/source/gen12lp/hw_info_adls.cpp index 546edbd95a..0c82e526be 100644 --- a/shared/source/gen12lp/hw_info_adls.cpp +++ b/shared/source/gen12lp/hw_info_adls.cpp @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen12lp/hw_cmds_adls.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -114,9 +115,9 @@ void ADLS::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waUntypedBufferCompression = true; }; -void ADLS::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void ADLS::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * ADLS::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalPsThreadsWindowerRange = 64; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->MaxEuPerSubSlice = ADLS::maxEuPerSubslice; @@ -140,8 +141,8 @@ const HardwareInfo AdlsHwConfig::hwInfo = { AOT::ADL_S}; GT_SYSTEM_INFO AdlsHwConfig::gtSystemInfo = {0}; -void AdlsHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void AdlsHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; @@ -162,9 +163,9 @@ void AdlsHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTabl const HardwareInfo ADLS::hwInfo = AdlsHwConfig::hwInfo; -void setupADLSHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - AdlsHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupADLSHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + AdlsHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*ADLS::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupADLSHardwareInfoImpl; +void (*ADLS::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupADLSHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen12lp/hw_info_dg1.cpp b/shared/source/gen12lp/hw_info_dg1.cpp index e5fffc8b3c..e08773499d 100644 --- a/shared/source/gen12lp/hw_info_dg1.cpp +++ b/shared/source/gen12lp/hw_info_dg1.cpp @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen12lp/hw_cmds_dg1.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -115,9 +116,9 @@ void DG1::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void DG1::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void DG1::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * DG1::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 672; gtSysInfo->TotalHsThreads = 672; gtSysInfo->TotalDsThreads = 672; @@ -145,8 +146,8 @@ const HardwareInfo Dg1HwConfig::hwInfo = { AOT::DG1}; GT_SYSTEM_INFO Dg1HwConfig::gtSystemInfo = {0}; -void Dg1HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - DG1::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void Dg1HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + DG1::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -162,16 +163,16 @@ void Dg1HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable const HardwareInfo DG1::hwInfo = Dg1HwConfig::hwInfo; -void setupDG1HardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupDG1HardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100060010) { - Dg1HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + Dg1HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - Dg1HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + Dg1HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*DG1::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupDG1HardwareInfoImpl; +void (*DG1::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupDG1HardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen12lp/hw_info_rkl.cpp b/shared/source/gen12lp/hw_info_rkl.cpp index a004c5204e..412193a692 100644 --- a/shared/source/gen12lp/hw_info_rkl.cpp +++ b/shared/source/gen12lp/hw_info_rkl.cpp @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen12lp/hw_cmds_rkl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -113,9 +114,9 @@ void RKL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void RKL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void RKL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * RKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 0; gtSysInfo->TotalHsThreads = 0; gtSysInfo->TotalDsThreads = 0; @@ -143,8 +144,8 @@ const HardwareInfo RklHwConfig::hwInfo = { AOT::RKL}; GT_SYSTEM_INFO RklHwConfig::gtSystemInfo = {0}; -void RklHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - RKL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void RklHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + RKL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; @@ -159,9 +160,9 @@ void RklHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTable const HardwareInfo RKL::hwInfo = RklHwConfig::hwInfo; -void setupRKLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - RklHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupRKLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + RklHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*RKL::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupRKLHardwareInfoImpl; +void (*RKL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupRKLHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen12lp/hw_info_tgllp.cpp b/shared/source/gen12lp/hw_info_tgllp.cpp index e19bd0a307..0b01215a9b 100644 --- a/shared/source/gen12lp/hw_info_tgllp.cpp +++ b/shared/source/gen12lp/hw_info_tgllp.cpp @@ -10,6 +10,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen12lp/hw_cmds_tgllp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -114,9 +115,9 @@ void TGLLP::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waUntypedBufferCompression = true; }; -void TGLLP::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void TGLLP::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * TGLLP::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalPsThreadsWindowerRange = 64; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->MaxEuPerSubSlice = TGLLP::maxEuPerSubslice; @@ -140,8 +141,8 @@ const HardwareInfo TgllpHw1x6x16::hwInfo = { AOT::TGL}; GT_SYSTEM_INFO TgllpHw1x6x16::gtSystemInfo = {0}; -void TgllpHw1x6x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - TGLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void TgllpHw1x6x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + TGLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -168,8 +169,8 @@ const HardwareInfo TgllpHw1x2x16::hwInfo = { AOT::TGL}; GT_SYSTEM_INFO TgllpHw1x2x16::gtSystemInfo = {0}; -void TgllpHw1x2x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - TGLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void TgllpHw1x2x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + TGLLP::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -189,18 +190,18 @@ void TgllpHw1x2x16::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTab const HardwareInfo TGLLP::hwInfo = TgllpHw1x6x16::hwInfo; -void setupTGLLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupTGLLPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100060010) { - TgllpHw1x6x16::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + TgllpHw1x6x16::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100020010) { - TgllpHw1x2x16::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + TgllpHw1x2x16::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - TgllpHw1x6x16::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + TgllpHw1x6x16::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*TGLLP::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupTGLLPHardwareInfoImpl; +void (*TGLLP::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupTGLLPHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp index 06033c892c..5b38fa4c92 100644 --- a/shared/source/gen8/enable_compiler_product_helper_bdw.cpp +++ b/shared/source/gen8/enable_compiler_product_helper_bdw.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_bdw.h" diff --git a/shared/source/gen8/hw_cmds_bdw.h b/shared/source/gen8/hw_cmds_bdw.h index 53ff35f66a..f640e99d87 100644 --- a/shared/source/gen8/hw_cmds_bdw.h +++ b/shared/source/gen8/hw_cmds_bdw.h @@ -18,18 +18,17 @@ struct BDW : public Gen8Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 2; static const uint32_t maxSubslicesSupported = 6; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class BdwHw1x2x6 : public BDW { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -37,7 +36,7 @@ class BdwHw1x2x6 : public BDW { }; class BdwHw1x3x6 : public BDW { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -45,7 +44,7 @@ class BdwHw1x3x6 : public BDW { }; class BdwHw1x3x8 : public BDW { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -53,7 +52,7 @@ class BdwHw1x3x8 : public BDW { }; class BdwHw2x3x8 : public BDW { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen8/hw_info_bdw.cpp b/shared/source/gen8/hw_info_bdw.cpp index 1e11a415d9..814117f283 100644 --- a/shared/source/gen8/hw_info_bdw.cpp +++ b/shared/source/gen8/hw_info_bdw.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen8/hw_cmds_bdw.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -101,9 +102,9 @@ void BDW::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads = true; } -void BDW::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void BDW::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * BDW::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -130,8 +131,8 @@ const HardwareInfo BdwHw1x2x6::hwInfo = { AOT::BDW}; GT_SYSTEM_INFO BdwHw1x2x6::gtSystemInfo = {0}; -void BdwHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void BdwHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -148,8 +149,8 @@ const HardwareInfo BdwHw1x3x6::hwInfo = { BDW::capabilityTable, AOT::BDW}; GT_SYSTEM_INFO BdwHw1x3x6::gtSystemInfo = {0}; -void BdwHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void BdwHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -166,8 +167,8 @@ const HardwareInfo BdwHw1x3x8::hwInfo = { BDW::capabilityTable, AOT::BDW}; GT_SYSTEM_INFO BdwHw1x3x8::gtSystemInfo = {0}; -void BdwHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void BdwHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -184,8 +185,8 @@ const HardwareInfo BdwHw2x3x8::hwInfo = { BDW::capabilityTable, AOT::BDW}; GT_SYSTEM_INFO BdwHw2x3x8::gtSystemInfo = {0}; -void BdwHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void BdwHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + BDW::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 2; @@ -196,22 +197,22 @@ void BdwHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo BDW::hwInfo = BdwHw1x3x8::hwInfo; -void setupBDWHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupBDWHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x200030008) { - BdwHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BdwHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030008) { - BdwHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BdwHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030006) { - BdwHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BdwHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100020006) { - BdwHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BdwHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - BdwHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BdwHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*BDW::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupBDWHardwareInfoImpl; +void (*BDW::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupBDWHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp index 1b96178129..41fcb96ba5 100644 --- a/shared/source/gen9/enable_compiler_product_helper_bxt.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_bxt.cpp @@ -20,6 +20,11 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const HardwareIn return 0x100030006; } +template <> +uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { + return 6; +} + 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 cb62d42b90..5ca564f166 100644 --- a/shared/source/gen9/enable_compiler_product_helper_cfl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_cfl.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_cfl.h" diff --git a/shared/source/gen9/enable_compiler_product_helper_glk.cpp b/shared/source/gen9/enable_compiler_product_helper_glk.cpp index c66d61e044..aba74ba4d1 100644 --- a/shared/source/gen9/enable_compiler_product_helper_glk.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_glk.cpp @@ -19,6 +19,11 @@ uint64_t CompilerProductHelperHw::getHwInfoConfig(const Hardwar return 0x100030006; } +template <> +uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { + return 6; +} + 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 477852b288..e3e48ae07d 100644 --- a/shared/source/gen9/enable_compiler_product_helper_kbl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_kbl.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_kbl.h" diff --git a/shared/source/gen9/enable_compiler_product_helper_skl.cpp b/shared/source/gen9/enable_compiler_product_helper_skl.cpp index 1ef500e4d8..2f0fb9a53d 100644 --- a/shared/source/gen9/enable_compiler_product_helper_skl.cpp +++ b/shared/source/gen9/enable_compiler_product_helper_skl.cpp @@ -9,6 +9,7 @@ #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_hp.inl" #include "shared/source/helpers/compiler_product_helper_before_xe_hpc.inl" #include "hw_info_skl.h" diff --git a/shared/source/gen9/hw_cmds_bxt.h b/shared/source/gen9/hw_cmds_bxt.h index 406b50444c..f5e46d714c 100644 --- a/shared/source/gen9/hw_cmds_bxt.h +++ b/shared/source/gen9/hw_cmds_bxt.h @@ -16,20 +16,19 @@ struct BXT : public Gen9Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 6; static const uint32_t maxEuPerSubslice = 6; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 3; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class BxtHw1x2x6 : public BXT { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -38,7 +37,7 @@ class BxtHw1x2x6 : public BXT { class BxtHw1x3x6 : public BXT { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen9/hw_cmds_cfl.h b/shared/source/gen9/hw_cmds_cfl.h index 3b3f084d3d..1789d9887b 100644 --- a/shared/source/gen9/hw_cmds_cfl.h +++ b/shared/source/gen9/hw_cmds_cfl.h @@ -16,20 +16,19 @@ struct CFL : public Gen9Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 3; static const uint32_t maxSubslicesSupported = 9; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class CflHw1x2x6 : public CFL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -38,7 +37,7 @@ class CflHw1x2x6 : public CFL { class CflHw1x3x6 : public CFL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -47,7 +46,7 @@ class CflHw1x3x6 : public CFL { class CflHw1x3x8 : public CFL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -56,7 +55,7 @@ class CflHw1x3x8 : public CFL { class CflHw2x3x8 : public CFL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -65,7 +64,7 @@ class CflHw2x3x8 : public CFL { class CflHw3x3x8 : public CFL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen9/hw_cmds_glk.h b/shared/source/gen9/hw_cmds_glk.h index 0ece9c2d24..4236191aee 100644 --- a/shared/source/gen9/hw_cmds_glk.h +++ b/shared/source/gen9/hw_cmds_glk.h @@ -16,20 +16,19 @@ struct GLK : public Gen9Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 6; static const uint32_t maxEuPerSubslice = 6; static const uint32_t maxSlicesSupported = 1; static const uint32_t maxSubslicesSupported = 3; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class GlkHw1x3x6 : public GLK { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -38,7 +37,7 @@ class GlkHw1x3x6 : public GLK { class GlkHw1x2x6 : public GLK { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen9/hw_cmds_kbl.h b/shared/source/gen9/hw_cmds_kbl.h index 7e00d85606..e6250ed2cb 100644 --- a/shared/source/gen9/hw_cmds_kbl.h +++ b/shared/source/gen9/hw_cmds_kbl.h @@ -16,20 +16,19 @@ struct KBL : public Gen9Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 3; static const uint32_t maxSubslicesSupported = 9; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class KblHw1x2x6 : public KBL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -38,7 +37,7 @@ class KblHw1x2x6 : public KBL { class KblHw1x3x6 : public KBL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -47,7 +46,7 @@ class KblHw1x3x6 : public KBL { class KblHw1x3x8 : public KBL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -56,7 +55,7 @@ class KblHw1x3x8 : public KBL { class KblHw2x3x8 : public KBL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -65,7 +64,7 @@ class KblHw2x3x8 : public KBL { class KblHw3x3x8 : public KBL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen9/hw_cmds_skl.h b/shared/source/gen9/hw_cmds_skl.h index afa0665974..2d773bb145 100644 --- a/shared/source/gen9/hw_cmds_skl.h +++ b/shared/source/gen9/hw_cmds_skl.h @@ -16,20 +16,19 @@ struct SKL : public Gen9Family { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 7; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 3; static const uint32_t maxSubslicesSupported = 9; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class SklHw1x2x6 : public SKL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -38,7 +37,7 @@ class SklHw1x2x6 : public SKL { class SklHw1x3x6 : public SKL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -47,7 +46,7 @@ class SklHw1x3x6 : public SKL { class SklHw1x3x8 : public SKL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -56,7 +55,7 @@ class SklHw1x3x8 : public SKL { class SklHw2x3x8 : public SKL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: @@ -65,7 +64,7 @@ class SklHw2x3x8 : public SKL { class SklHw3x3x8 : public SKL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/gen9/hw_info_bxt.cpp b/shared/source/gen9/hw_info_bxt.cpp index 4191407a4d..288673f8ff 100644 --- a/shared/source/gen9/hw_info_bxt.cpp +++ b/shared/source/gen9/hw_info_bxt.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen9/hw_cmds_bxt.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -110,9 +111,9 @@ void BXT::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads = true; } -void BXT::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void BXT::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * BXT::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 112; gtSysInfo->TotalHsThreads = 112; gtSysInfo->TotalDsThreads = 112; @@ -138,8 +139,8 @@ const HardwareInfo BxtHw1x2x6::hwInfo = { BXT::capabilityTable, AOT::APL}; GT_SYSTEM_INFO BxtHw1x2x6::gtSystemInfo = {0}; -void BxtHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - BXT::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void BxtHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + BXT::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -156,8 +157,8 @@ const HardwareInfo BxtHw1x3x6::hwInfo = { BXT::capabilityTable, AOT::APL}; GT_SYSTEM_INFO BxtHw1x3x6::gtSystemInfo = {0}; -void BxtHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - BXT::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void BxtHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + BXT::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -168,18 +169,18 @@ void BxtHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo BXT::hwInfo = BxtHw1x3x6::hwInfo; -void setupBXTHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupBXTHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100020006) { - BxtHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BxtHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030006) { - BxtHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BxtHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - BxtHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + BxtHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*BXT::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupBXTHardwareInfoImpl; +void (*BXT::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupBXTHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen9/hw_info_cfl.cpp b/shared/source/gen9/hw_info_cfl.cpp index fc9d0d6598..27d829d2e0 100644 --- a/shared/source/gen9/hw_info_cfl.cpp +++ b/shared/source/gen9/hw_info_cfl.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen9/hw_cmds_cfl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -109,9 +110,9 @@ void CFL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads = true; } -void CFL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void CFL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * CFL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -137,8 +138,8 @@ const HardwareInfo CflHw1x2x6::hwInfo = { CFL::capabilityTable, AOT::CFL}; GT_SYSTEM_INFO CflHw1x2x6::gtSystemInfo = {0}; -void CflHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void CflHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -156,8 +157,8 @@ const HardwareInfo CflHw1x3x6::hwInfo = { AOT::CFL}; GT_SYSTEM_INFO CflHw1x3x6::gtSystemInfo = {0}; -void CflHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void CflHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -175,8 +176,8 @@ const HardwareInfo CflHw1x3x8::hwInfo = { AOT::CFL}; GT_SYSTEM_INFO CflHw1x3x8::gtSystemInfo = {0}; -void CflHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void CflHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -193,8 +194,8 @@ const HardwareInfo CflHw2x3x8::hwInfo = { CFL::capabilityTable, AOT::CFL}; GT_SYSTEM_INFO CflHw2x3x8::gtSystemInfo = {0}; -void CflHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void CflHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 2; @@ -211,8 +212,8 @@ const HardwareInfo CflHw3x3x8::hwInfo = { CFL::capabilityTable, AOT::CFL}; GT_SYSTEM_INFO CflHw3x3x8::gtSystemInfo = {0}; -void CflHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void CflHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + CFL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 3; @@ -223,24 +224,24 @@ void CflHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo CFL::hwInfo = CflHw1x3x6::hwInfo; -void setupCFLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupCFLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100030008) { - CflHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + CflHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x200030008) { - CflHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + CflHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x300030008) { - CflHw3x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + CflHw3x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100020006) { - CflHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + CflHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030006) { - CflHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + CflHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - CflHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + CflHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*CFL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupCFLHardwareInfoImpl; +void (*CFL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupCFLHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen9/hw_info_glk.cpp b/shared/source/gen9/hw_info_glk.cpp index 7f168181ba..d612dbad26 100644 --- a/shared/source/gen9/hw_info_glk.cpp +++ b/shared/source/gen9/hw_info_glk.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen9/hw_cmds_glk.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -111,9 +112,9 @@ void GLK::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waSamplerCacheFlushBetweenRedescribedSurfaceReads = true; } -void GLK::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void GLK::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * GLK::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 112; gtSysInfo->TotalHsThreads = 112; gtSysInfo->TotalDsThreads = 112; @@ -140,8 +141,8 @@ const HardwareInfo GlkHw1x3x6::hwInfo = { AOT::GLK}; GT_SYSTEM_INFO GlkHw1x3x6::gtSystemInfo = {0}; -void GlkHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - GLK::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void GlkHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + GLK::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -159,8 +160,8 @@ const HardwareInfo GlkHw1x2x6::hwInfo = { AOT::GLK}; GT_SYSTEM_INFO GlkHw1x2x6::gtSystemInfo = {0}; -void GlkHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - GLK::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void GlkHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + GLK::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -171,18 +172,18 @@ void GlkHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo GLK::hwInfo = GlkHw1x3x6::hwInfo; -void setupGLKHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupGLKHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100020006) { - GlkHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + GlkHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030006) { - GlkHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + GlkHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - GlkHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + GlkHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*GLK::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupGLKHardwareInfoImpl; +void (*GLK::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupGLKHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen9/hw_info_kbl.cpp b/shared/source/gen9/hw_info_kbl.cpp index cdb34d5bfe..15b0d69416 100644 --- a/shared/source/gen9/hw_info_kbl.cpp +++ b/shared/source/gen9/hw_info_kbl.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen9/hw_cmds_kbl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -115,9 +116,9 @@ void KBL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { } } -void KBL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void KBL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * KBL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -143,8 +144,8 @@ const HardwareInfo KblHw1x2x6::hwInfo = { KBL::capabilityTable, AOT::KBL}; GT_SYSTEM_INFO KblHw1x2x6::gtSystemInfo = {0}; -void KblHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void KblHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -162,8 +163,8 @@ const HardwareInfo KblHw1x3x6::hwInfo = { AOT::KBL}; GT_SYSTEM_INFO KblHw1x3x6::gtSystemInfo = {0}; -void KblHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void KblHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -180,8 +181,8 @@ const HardwareInfo KblHw1x3x8::hwInfo = { KBL::capabilityTable, AOT::KBL}; GT_SYSTEM_INFO KblHw1x3x8::gtSystemInfo = {0}; -void KblHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void KblHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -198,8 +199,8 @@ const HardwareInfo KblHw2x3x8::hwInfo = { KBL::capabilityTable, AOT::KBL}; GT_SYSTEM_INFO KblHw2x3x8::gtSystemInfo = {0}; -void KblHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void KblHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 2; @@ -216,8 +217,8 @@ const HardwareInfo KblHw3x3x8::hwInfo = { KBL::capabilityTable, AOT::KBL}; GT_SYSTEM_INFO KblHw3x3x8::gtSystemInfo = {0}; -void KblHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void KblHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + KBL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 3; @@ -228,24 +229,24 @@ void KblHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo KBL::hwInfo = KblHw1x3x6::hwInfo; -void setupKBLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupKBLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100030008) { - KblHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + KblHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x200030008) { - KblHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + KblHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x300030008) { - KblHw3x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + KblHw3x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100020006) { - KblHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + KblHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030006) { - KblHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + KblHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - KblHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + KblHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*KBL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupKBLHardwareInfoImpl; +void (*KBL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupKBLHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/gen9/hw_info_skl.cpp b/shared/source/gen9/hw_info_skl.cpp index c1f3d93c6e..2f63cb884b 100644 --- a/shared/source/gen9/hw_info_skl.cpp +++ b/shared/source/gen9/hw_info_skl.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/gen9/hw_cmds_skl.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "aubstream/engine_node.h" @@ -122,9 +123,9 @@ void SKL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { } } -void SKL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void SKL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * SKL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -150,8 +151,8 @@ const HardwareInfo SklHw1x2x6::hwInfo = { SKL::capabilityTable, AOT::SKL}; GT_SYSTEM_INFO SklHw1x2x6::gtSystemInfo = {0}; -void SklHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void SklHw1x2x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -168,8 +169,8 @@ const HardwareInfo SklHw1x3x6::hwInfo = { SKL::capabilityTable, AOT::SKL}; GT_SYSTEM_INFO SklHw1x3x6::gtSystemInfo = {0}; -void SklHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void SklHw1x3x6::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -186,8 +187,8 @@ const HardwareInfo SklHw1x3x8::hwInfo = { SKL::capabilityTable, AOT::SKL}; GT_SYSTEM_INFO SklHw1x3x8::gtSystemInfo = {0}; -void SklHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void SklHw1x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 1; @@ -204,8 +205,8 @@ const HardwareInfo SklHw2x3x8::hwInfo = { SKL::capabilityTable, AOT::SKL}; GT_SYSTEM_INFO SklHw2x3x8::gtSystemInfo = {0}; -void SklHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void SklHw2x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 2; @@ -222,8 +223,8 @@ const HardwareInfo SklHw3x3x8::hwInfo = { SKL::capabilityTable, AOT::SKL}; GT_SYSTEM_INFO SklHw3x3x8::gtSystemInfo = {0}; -void SklHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void SklHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->SliceCount = 3; @@ -234,24 +235,24 @@ void SklHw3x3x8::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableA const HardwareInfo SKL::hwInfo = SklHw1x3x8::hwInfo; -void setupSKLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { +void setupSKLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { if (hwInfoConfig == 0x100030008) { - SklHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + SklHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x200030008) { - SklHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + SklHw2x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x300030008) { - SklHw3x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + SklHw3x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100020006) { - SklHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + SklHw1x2x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x100030006) { - SklHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + SklHw1x3x6::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else if (hwInfoConfig == 0x0) { // Default config - SklHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + SklHw1x3x8::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } else { UNRECOVERABLE_IF(true); } } -void (*SKL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t) = setupSKLHardwareInfoImpl; +void (*SKL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupSKLHardwareInfoImpl; } // namespace NEO diff --git a/shared/source/helpers/CMakeLists.txt b/shared/source/helpers/CMakeLists.txt index 9b5f7663f5..cf60529418 100644 --- a/shared/source/helpers/CMakeLists.txt +++ b/shared/source/helpers/CMakeLists.txt @@ -43,7 +43,9 @@ set(NEO_CORE_HELPERS ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_base.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_aot_config_bdw_and_later.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_bdw_and_later.inl + ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_before_xe_hp.inl ${CMAKE_CURRENT_SOURCE_DIR}/compiler_product_helper_before_xe_hpc.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 ${CMAKE_CURRENT_SOURCE_DIR}/compiler_options_parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/compiler_options_parser.h diff --git a/shared/source/helpers/compiler_product_helper.h b/shared/source/helpers/compiler_product_helper.h index 61cd4288e2..c8717dca43 100644 --- a/shared/source/helpers/compiler_product_helper.h +++ b/shared/source/helpers/compiler_product_helper.h @@ -41,6 +41,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 getNumThreadsPerEu() const = 0; virtual ~CompilerProductHelper() = default; @@ -64,6 +65,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 getNumThreadsPerEu() const override; ~CompilerProductHelperHw() override = default; diff --git a/shared/source/helpers/compiler_product_helper_before_xe_hp.inl b/shared/source/helpers/compiler_product_helper_before_xe_hp.inl new file mode 100644 index 0000000000..f699f1d22a --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_before_xe_hp.inl @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { + return 7u; +} + +} // namespace NEO diff --git a/shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl b/shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl new file mode 100644 index 0000000000..633d75d9aa --- /dev/null +++ b/shared/source/helpers/compiler_product_helper_xe_hp_and_later.inl @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2023 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once + +#include "shared/source/helpers/compiler_product_helper.h" + +namespace NEO { +template +uint32_t CompilerProductHelperHw::getNumThreadsPerEu() const { + return 8u; +} + +} // namespace NEO diff --git a/shared/source/helpers/hw_info.cpp b/shared/source/helpers/hw_info.cpp index 3a4eea1591..337d9ee094 100644 --- a/shared/source/helpers/hw_info.cpp +++ b/shared/source/helpers/hw_info.cpp @@ -30,11 +30,11 @@ bool familyEnabled[IGFX_MAX_CORE] = { }; const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {}; -void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, uint64_t) = { +void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = { 0x0, }; -void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool) = { +void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, const CompilerProductHelper &) = { 0x0, }; diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index 924ed21360..dc3a5f15f7 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -16,6 +16,7 @@ namespace NEO { enum PreemptionMode : uint32_t; +class CompilerProductHelper; struct RuntimeCapabilityTable { DirectSubmissionProperyEngines directSubmissionEngines; @@ -154,8 +155,8 @@ struct HardwareInfo { extern bool familyEnabled[IGFX_MAX_CORE]; extern const char *hardwarePrefix[IGFX_MAX_PRODUCT]; extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT]; -extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); -extern void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); +extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); +extern void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &); template struct EnableGfxFamilyHw { diff --git a/shared/source/os_interface/device_factory.cpp b/shared/source/os_interface/device_factory.cpp index 053bc3cc18..96566c2e3d 100644 --- a/shared/source/os_interface/device_factory.cpp +++ b/shared/source/os_interface/device_factory.cpp @@ -73,7 +73,7 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE setHwInfoValuesFromConfig(hwInfoConfig, *hardwareInfo); - hardwareInfoSetup[hwInfoConst->platform.eProductFamily](hardwareInfo, true, hwInfoConfig); + hardwareInfoSetup[hwInfoConst->platform.eProductFamily](hardwareInfo, true, hwInfoConfig, compilerProductHelper); auto &productHelper = rootDeviceEnvironment.getProductHelper(); productHelper.configureHardwareCustom(hardwareInfo, nullptr); diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index fb649662b5..cbc078eb3e 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -209,8 +209,5 @@ class ProductHelper { virtual LocalMemoryAccessMode getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const = 0; virtual void fillScmPropertiesSupportStructureBase(StateComputeModePropertiesSupport &propertiesSupport) const = 0; - - public: - uint32_t threadsPerEu = 0u; }; } // namespace NEO diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 9bfb1a2295..c37dbd6df3 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -11,6 +11,7 @@ #include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/constants.h" +#include "shared/source/helpers/hw_mapper.h" #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/helpers/preamble.h" #include "shared/source/memory_manager/graphics_allocation.h" diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index 6560c467b8..3ced167010 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -468,7 +468,8 @@ int Drm::setupHardwareInfo(const DeviceDescriptor *device, bool setupFeatureTabl } status = querySystemInfo(); - device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); + auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); + device->setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); if (status) { systemInfo->checkSysInfoMismatch(hwInfo); diff --git a/shared/source/os_interface/linux/drm_neo.h b/shared/source/os_interface/linux/drm_neo.h index 85a3afce20..62358e230b 100644 --- a/shared/source/os_interface/linux/drm_neo.h +++ b/shared/source/os_interface/linux/drm_neo.h @@ -41,6 +41,7 @@ enum class CacheRegion : uint16_t; enum class SubmissionStatus : uint32_t; class BufferObject; +class CompilerProductHelper; class DeviceFactory; class MemoryInfo; class OsContext; @@ -55,7 +56,7 @@ struct SystemInfo; struct DeviceDescriptor { unsigned short deviceId; const HardwareInfo *pHwInfo; - void (*setupHardwareInfo)(HardwareInfo *, bool); + void (*setupHardwareInfo)(HardwareInfo *, bool, const CompilerProductHelper &); const char *devName; }; diff --git a/shared/source/os_interface/linux/hw_info_config_drm.cpp b/shared/source/os_interface/linux/hw_info_config_drm.cpp index f6dd405542..dbf190b82c 100644 --- a/shared/source/os_interface/linux/hw_info_config_drm.cpp +++ b/shared/source/os_interface/linux/hw_info_config_drm.cpp @@ -101,11 +101,13 @@ int ProductHelper::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo topologyData.maxSubSliceCount = topologyData.sliceCount > 0 ? topologyData.subSliceCount / topologyData.sliceCount : 0; } + auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); + gtSystemInfo->SliceCount = static_cast(topologyData.sliceCount); gtSystemInfo->SubSliceCount = static_cast(topologyData.subSliceCount); gtSystemInfo->DualSubSliceCount = static_cast(topologyData.subSliceCount); gtSystemInfo->EUCount = static_cast(topologyData.euCount); - gtSystemInfo->ThreadCount = this->threadsPerEu * gtSystemInfo->EUCount; + gtSystemInfo->ThreadCount = compilerProductHelper.getNumThreadsPerEu() * gtSystemInfo->EUCount; gtSystemInfo->MaxEuPerSubSlice = gtSystemInfo->MaxEuPerSubSlice != 0 ? gtSystemInfo->MaxEuPerSubSlice : topologyData.maxEuCount; gtSystemInfo->MaxSubSlicesSupported = std::max(static_cast(topologyData.maxSubSliceCount * topologyData.maxSliceCount), gtSystemInfo->MaxSubSlicesSupported); @@ -151,7 +153,6 @@ int ProductHelper::configureHwInfoDrm(const HardwareInfo *inHwInfo, HardwareInfo drm->checkNonPersistentContextsSupport(); drm->checkPreemptionSupport(); bool preemption = drm->isPreemptionSupported(); - auto &compilerProductHelper = rootDeviceEnvironment.getHelper(); PreemptionHelper::adjustDefaultPreemptionMode(outHwInfo->capabilityTable, compilerProductHelper.isMidThreadPreemptionSupported(*outHwInfo) && preemption, static_cast(outHwInfo->featureTable.flags.ftrGpGpuThreadGroupLevelPreempt) && preemption, diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 8a6edc0d70..3b8424f348 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -6,7 +6,6 @@ */ #pragma once -#include "shared/source/helpers/hw_mapper.h" #include "shared/source/os_interface/hw_info_config.h" namespace NEO { @@ -17,9 +16,6 @@ class ProductHelperHw : public ProductHelper { static std::unique_ptr create() { auto productHelper = std::unique_ptr(new ProductHelperHw()); - using GfxProduct = typename HwMapper::GfxProduct; - productHelper->threadsPerEu = GfxProduct::threadsPerEu; - return productHelper; } @@ -177,13 +173,10 @@ class ProductHelperHw : public ProductHelper { template struct EnableProductHelper { - - using GfxProduct = typename HwMapper::GfxProduct; - EnableProductHelper() { auto productHelperCreateFunction = ProductHelperHw::create; productHelperFactory[gfxProduct] = productHelperCreateFunction; } }; -} // namespace NEO \ No newline at end of file +} // namespace NEO diff --git a/shared/source/xe_hp_core/definitions/hw_info_setup_xehp.inl b/shared/source/xe_hp_core/definitions/hw_info_setup_xehp.inl index a3c713ae73..4bde5f07fb 100644 --- a/shared/source/xe_hp_core/definitions/hw_info_setup_xehp.inl +++ b/shared/source/xe_hp_core/definitions/hw_info_setup_xehp.inl @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,9 +8,9 @@ const HardwareInfo XE_HP_SDV::hwInfo = XehpSdvHwConfig::hwInfo; const uint64_t XE_HP_SDV::defaultHardwareInfoConfig = 0; -void setupXEHPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - XE_HP_SDV::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); - XehpSdvHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupXEHPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + XE_HP_SDV::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); + XehpSdvHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*XE_HP_SDV::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupXEHPHardwareInfoImpl; +void (*XE_HP_SDV::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupXEHPHardwareInfoImpl; diff --git a/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp b/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp index 5c64de421c..dac76824ba 100644 --- a/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/enable_compiler_product_helper_xe_hp_sdv.cpp @@ -10,6 +10,7 @@ #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_xe_hp_and_later.inl" #include "hw_info_xehp.h" diff --git a/shared/source/xe_hp_core/hw_cmds_xe_hp_sdv.h b/shared/source/xe_hp_core/hw_cmds_xe_hp_sdv.h index aefd76dc6a..7b7c1fc78e 100644 --- a/shared/source/xe_hp_core/hw_cmds_xe_hp_sdv.h +++ b/shared/source/xe_hp_core/hw_cmds_xe_hp_sdv.h @@ -15,20 +15,19 @@ struct XE_HP_SDV : public XeHpFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - static const uint32_t threadsPerEu = 8; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 8; static const uint32_t maxSubslicesSupported = 32; static const uint32_t maxDualSubslicesSupported = 32; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); }; class XehpSdvHwConfig : public XE_HP_SDV { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp b/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp index 6b09d2c0ba..23763cdbe1 100644 --- a/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp +++ b/shared/source/xe_hp_core/hw_info_xe_hp_sdv.cpp @@ -117,9 +117,9 @@ void XE_HP_SDV::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void XE_HP_SDV::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void XE_HP_SDV::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * XE_HP_SDV::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -146,7 +146,7 @@ const HardwareInfo XehpSdvHwConfig::hwInfo = { XE_HP_SDV::capabilityTable, }; GT_SYSTEM_INFO XehpSdvHwConfig::gtSystemInfo = {0}; -void XehpSdvHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void XehpSdvHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->IsL3HashModeEnabled = false; diff --git a/shared/source/xe_hpc_core/definitions/hw_info_setup_pvc.inl b/shared/source/xe_hpc_core/definitions/hw_info_setup_pvc.inl index 72cbf68ce8..6e30aed1b0 100644 --- a/shared/source/xe_hpc_core/definitions/hw_info_setup_pvc.inl +++ b/shared/source/xe_hpc_core/definitions/hw_info_setup_pvc.inl @@ -7,9 +7,9 @@ const HardwareInfo PVC::hwInfo = PvcHwConfig::hwInfo; -void setupPVCHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - PVC::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); - PvcHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupPVCHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + PVC::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); + PvcHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*PVC::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupPVCHardwareInfoImpl; +void (*PVC::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupPVCHardwareInfoImpl; 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 ad4b717fcb..83770b920f 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 @@ -9,6 +9,7 @@ #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_xe_hp_and_later.inl" #include "shared/source/helpers/compiler_product_helper_xe_hpc_and_later.inl" #include "compiler_product_helper_pvc.inl" diff --git a/shared/source/xe_hpc_core/hw_cmds_pvc.h b/shared/source/xe_hpc_core/hw_cmds_pvc.h index 52686f0ad7..51ade71bd0 100644 --- a/shared/source/xe_hpc_core/hw_cmds_pvc.h +++ b/shared/source/xe_hpc_core/hw_cmds_pvc.h @@ -18,7 +18,6 @@ struct PVC : public XeHpcCoreFamily { static FeatureTable featureTable; static WorkaroundTable workaroundTable; // Initial non-zero values for unit tests - static const uint32_t threadsPerEu = 8; static const uint32_t maxEuPerSubslice = 8; static const uint32_t maxSlicesSupported = 8; static const uint32_t maxSubslicesSupported = 64; @@ -44,9 +43,9 @@ struct PVC : public XeHpcCoreFamily { static constexpr bool devicePreemptionMode = false; }; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static void setupHardwareInfoMultiTileBase(HardwareInfo *hwInfo, bool setupMultiTile); static void adjustHardwareInfo(HardwareInfo *hwInfo); @@ -71,7 +70,7 @@ struct PVC : public XeHpcCoreFamily { class PvcHwConfig : public PVC { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/xe_hpc_core/hw_info_pvc.cpp b/shared/source/xe_hpc_core/hw_info_pvc.cpp index 7c89ce849a..9ec0d0ae0c 100644 --- a/shared/source/xe_hpc_core/hw_info_pvc.cpp +++ b/shared/source/xe_hpc_core/hw_info_pvc.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/unified_memory/usm_memory_support.h" #include "shared/source/xe_hpc_core/hw_cmds_pvc.h" @@ -131,9 +132,9 @@ void PVC::adjustHardwareInfo(HardwareInfo *hwInfo) { hwInfo->capabilityTable.sharedSystemMemCapabilities = (UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS); } -void PVC::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void PVC::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * PVC::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->MaxFillRate = 128; gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; @@ -177,8 +178,8 @@ const HardwareInfo PvcHwConfig::hwInfo = { AOT::PVC_XT_A0}; GT_SYSTEM_INFO PvcHwConfig::gtSystemInfo = {0}; -void PvcHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { - PVC::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); +void PvcHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { + PVC::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->IsL3HashModeEnabled = false; diff --git a/shared/source/xe_hpg_core/definitions/hw_info_setup_dg2.inl b/shared/source/xe_hpg_core/definitions/hw_info_setup_dg2.inl index ad77ef0ed2..eb8caac240 100644 --- a/shared/source/xe_hpg_core/definitions/hw_info_setup_dg2.inl +++ b/shared/source/xe_hpg_core/definitions/hw_info_setup_dg2.inl @@ -9,9 +9,9 @@ const HardwareInfo DG2::hwInfo = Dg2HwConfig::hwInfo; void DG2::adjustHardwareInfo(HardwareInfo *hwInfo) {} -void setupDG2HardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - DG2::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); - Dg2HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupDG2HardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + DG2::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); + Dg2HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*DG2::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupDG2HardwareInfoImpl; +void (*DG2::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupDG2HardwareInfoImpl; diff --git a/shared/source/xe_hpg_core/definitions/hw_info_setup_mtl.inl b/shared/source/xe_hpg_core/definitions/hw_info_setup_mtl.inl index 9b2ddeadf4..b03b65fb7f 100644 --- a/shared/source/xe_hpg_core/definitions/hw_info_setup_mtl.inl +++ b/shared/source/xe_hpg_core/definitions/hw_info_setup_mtl.inl @@ -8,10 +8,10 @@ namespace NEO { const HardwareInfo MTL::hwInfo = MtlHwConfig::hwInfo; -void setupMTLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig) { - MTL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable); - MtlHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable); +void setupMTLHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) { + MTL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); + MtlHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper); } -void (*MTL::setupHardwareInfo)(HardwareInfo *, bool, const uint64_t) = setupMTLHardwareInfoImpl; +void (*MTL::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupMTLHardwareInfoImpl; } // 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 74b3fd71cf..930e726e43 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 @@ -10,6 +10,7 @@ #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_xe_hp_and_later.inl" #include "compiler_product_helper_dg2.inl" #include "hw_info_dg2.h" 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 e2e3b95224..055aaa8982 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 @@ -10,6 +10,7 @@ #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_xe_hp_and_later.inl" #include "compiler_product_helper_mtl.inl" #include "hw_info_mtl.h" diff --git a/shared/source/xe_hpg_core/hw_cmds_dg2.h b/shared/source/xe_hpg_core/hw_cmds_dg2.h index f2e74da274..e999ad3580 100644 --- a/shared/source/xe_hpg_core/hw_cmds_dg2.h +++ b/shared/source/xe_hpg_core/hw_cmds_dg2.h @@ -26,16 +26,15 @@ struct DG2 : public XeHpgCoreFamily { static FeatureTable featureTable; static WorkaroundTable workaroundTable; // Initial non-zero values for unit tests - static const uint32_t threadsPerEu = 8; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 8; static const uint32_t maxSubslicesSupported = 32; static const uint32_t maxDualSubslicesSupported = 32; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); static void adjustHardwareInfo(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static bool isG10(const HardwareInfo &hwInfo) { auto it = std::find(dg2G10DeviceIds.begin(), dg2G10DeviceIds.end(), hwInfo.platform.usDeviceID); @@ -55,7 +54,7 @@ struct DG2 : public XeHpgCoreFamily { class Dg2HwConfig : public DG2 { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/xe_hpg_core/hw_cmds_mtl.h b/shared/source/xe_hpg_core/hw_cmds_mtl.h index bdd0f07849..415939f905 100644 --- a/shared/source/xe_hpg_core/hw_cmds_mtl.h +++ b/shared/source/xe_hpg_core/hw_cmds_mtl.h @@ -17,15 +17,14 @@ struct MTL : public XeHpgCoreFamily { static FeatureTable featureTable; static WorkaroundTable workaroundTable; // Initial non-zero values for unit tests - static const uint32_t threadsPerEu = 8; static const uint32_t maxEuPerSubslice = 16; static const uint32_t maxSlicesSupported = 8; static const uint32_t maxSubslicesSupported = 32; static const uint32_t maxDualSubslicesSupported = 32; static const RuntimeCapabilityTable capabilityTable; - static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig); + static void (*setupHardwareInfo)(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); - static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static void setupHardwareInfoMultiTileBase(HardwareInfo *hwInfo); static bool isLpg(const HardwareInfo &hwInfo) { @@ -36,7 +35,7 @@ struct MTL : public XeHpgCoreFamily { class MtlHwConfig : public MTL { public: - static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable); + static void setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper); static const HardwareInfo hwInfo; private: diff --git a/shared/source/xe_hpg_core/hw_info_dg2.cpp b/shared/source/xe_hpg_core/hw_info_dg2.cpp index a7dda8a4ef..99704e61d2 100644 --- a/shared/source/xe_hpg_core/hw_info_dg2.cpp +++ b/shared/source/xe_hpg_core/hw_info_dg2.cpp @@ -7,6 +7,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.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/xe_hpg_core/hw_cmds_dg2.h" @@ -121,9 +122,9 @@ void DG2::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; -void DG2::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void DG2::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * DG2::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -151,7 +152,7 @@ const HardwareInfo Dg2HwConfig::hwInfo = { DG2::capabilityTable, AOT::DG2_G10_A0}; GT_SYSTEM_INFO Dg2HwConfig::gtSystemInfo = {0}; -void Dg2HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void Dg2HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->IsL3HashModeEnabled = false; diff --git a/shared/source/xe_hpg_core/hw_info_mtl.cpp b/shared/source/xe_hpg_core/hw_info_mtl.cpp index 996fd77267..d45ce1a93a 100644 --- a/shared/source/xe_hpg_core/hw_info_mtl.cpp +++ b/shared/source/xe_hpg_core/hw_info_mtl.cpp @@ -8,6 +8,7 @@ #include "shared/source/aub_mem_dump/definitions/aub_services.h" #include "shared/source/command_stream/preemption_mode.h" #include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/xe_hpg_core/hw_cmds_mtl.h" @@ -114,9 +115,9 @@ void MTL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { workaroundTable->flags.waUntypedBufferCompression = true; }; -void MTL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void MTL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * MTL::threadsPerEu; + gtSysInfo->ThreadCount = gtSysInfo->EUCount * compilerProductHelper.getNumThreadsPerEu(); gtSysInfo->TotalVsThreads = 336; gtSysInfo->TotalHsThreads = 336; gtSysInfo->TotalDsThreads = 336; @@ -153,7 +154,7 @@ const HardwareInfo MtlHwConfig::hwInfo = { AOT::XE_LPG_MD_A0}; GT_SYSTEM_INFO MtlHwConfig::gtSystemInfo = {0}; -void MtlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable) { +void MtlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const CompilerProductHelper &compilerProductHelper) { GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; gtSysInfo->CsrSizeInMb = 8; gtSysInfo->IsL3HashModeEnabled = false; diff --git a/shared/test/common/mocks/mock_hw_info_config.cpp b/shared/test/common/mocks/mock_hw_info_config.cpp index 73c51230ed..2b287b39a6 100644 --- a/shared/test/common/mocks/mock_hw_info_config.cpp +++ b/shared/test/common/mocks/mock_hw_info_config.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" +#include "shared/source/helpers/hw_mapper.h" #include "shared/source/helpers/local_memory_access_modes.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/source/os_interface/product_helper_hw.h" diff --git a/shared/test/common/tests_configuration.cpp b/shared/test/common/tests_configuration.cpp index 74e59dcc6a..713c7b660b 100644 --- a/shared/test/common/tests_configuration.cpp +++ b/shared/test/common/tests_configuration.cpp @@ -9,7 +9,6 @@ #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" -#include "shared/source/os_interface/hw_info_config.h" namespace NEO { @@ -19,12 +18,11 @@ void adjustHwInfoForTests(HardwareInfo &hwInfoForTests, uint32_t euPerSubSlice, auto hwInfoConfig = compilerProductHelper->getHwInfoConfig(hwInfoForTests); setHwInfoValuesFromConfig(hwInfoConfig, hwInfoForTests); - auto productHelper = ProductHelper::create(hwInfoForTests.platform.eProductFamily); - uint32_t threadsPerEu = productHelper->threadsPerEu; + uint32_t threadsPerEu = compilerProductHelper->getNumThreadsPerEu(); // set Gt and FeatureTable to initial state bool setupFeatureTableAndWorkaroundTable = testMode == TestMode::AubTests ? true : false; - hardwareInfoSetup[hwInfoForTests.platform.eProductFamily](&hwInfoForTests, setupFeatureTableAndWorkaroundTable, hwInfoConfig); + hardwareInfoSetup[hwInfoForTests.platform.eProductFamily](&hwInfoForTests, setupFeatureTableAndWorkaroundTable, hwInfoConfig, *compilerProductHelper); GT_SYSTEM_INFO >SystemInfo = hwInfoForTests.gtSystemInfo; // and adjust dynamic values if not specified diff --git a/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp b/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp index da24115875..739b136300 100644 --- a/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/command_stream/aub_command_stream_receiver_tests_xehp_and_later.cpp @@ -7,6 +7,7 @@ #include "shared/source/aub_mem_dump/page_table_entry_bits.h" #include "shared/source/command_stream/aub_command_stream_receiver_hw.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/engine_node_helper.h" #include "shared/source/memory_manager/memory_banks.h" #include "shared/source/memory_manager/memory_pool.h" @@ -34,7 +35,8 @@ struct XeHPAndLaterAubCommandStreamReceiverTests : DeviceFixture, ::testing::Tes template void setUpImpl() { hardwareInfo = *defaultHwInfo; - hardwareInfoSetup[hardwareInfo.platform.eProductFamily](&hardwareInfo, true, 0); + auto compilerProductHelper = CompilerProductHelper::create(hardwareInfo.platform.eProductFamily); + hardwareInfoSetup[hardwareInfo.platform.eProductFamily](&hardwareInfo, true, 0, *compilerProductHelper); hardwareInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true; DeviceFixture::setUpImpl(&hardwareInfo); } diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_simulated_common_hw_tests_xehp_and_later.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_simulated_common_hw_tests_xehp_and_later.cpp index 8581aff41c..bab146e6ad 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_simulated_common_hw_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_simulated_common_hw_tests_xehp_and_later.cpp @@ -7,6 +7,7 @@ #include "shared/source/aub/aub_helper.h" #include "shared/source/command_stream/command_stream_receiver_simulated_common_hw.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hardware_context_controller.h" #include "shared/test/common/fixtures/device_fixture.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" @@ -194,7 +195,8 @@ class XeHPAndLaterTileRangeRegisterTest : public DeviceFixture, public ::testing template void setUpImpl() { hardwareInfo = *defaultHwInfo; - hardwareInfoSetup[hardwareInfo.platform.eProductFamily](&hardwareInfo, true, 0); + auto compilerProductHelper = CompilerProductHelper::create(hardwareInfo.platform.eProductFamily); + hardwareInfoSetup[hardwareInfo.platform.eProductFamily](&hardwareInfo, true, 0, *compilerProductHelper); hardwareInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true; DeviceFixture::setUpImpl(&hardwareInfo); } diff --git a/shared/test/unit_test/command_stream/get_devices_tests.cpp b/shared/test/unit_test/command_stream/get_devices_tests.cpp index 4cc127d738..f4f4c09164 100644 --- a/shared/test/unit_test/command_stream/get_devices_tests.cpp +++ b/shared/test/unit_test/command_stream/get_devices_tests.cpp @@ -175,6 +175,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca for (auto i = 0u; i < expectedDevices; i++) { hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo(); auto &productHelper = exeEnv.rootDeviceEnvironments[i]->getProductHelper(); + auto &compilerProductHelper = exeEnv.rootDeviceEnvironments[i]->getHelper(); switch (csrType) { case CSR_HW: case CSR_HW_WITH_AUB: @@ -202,7 +203,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca hwInfoFromTable.featureTable = {}; hwInfoFromTable.workaroundTable = {}; hwInfoFromTable.gtSystemInfo = {}; - hardwareInfoSetup[hwInfoFromTable.platform.eProductFamily](&hwInfoFromTable, true, 0x0); + hardwareInfoSetup[hwInfoFromTable.platform.eProductFamily](&hwInfoFromTable, true, 0x0, compilerProductHelper); productHelper.configureHardwareCustom(&hwInfoFromTable, nullptr); EXPECT_EQ(0, memcmp(&hwInfoFromTable.platform, &hwInfo->platform, sizeof(PLATFORM))); @@ -250,6 +251,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsS for (auto i = 0u; i < expectedDevices; i++) { hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo(); auto &productHelper = exeEnv.rootDeviceEnvironments[i]->getProductHelper(); + auto &compilerProductHelper = exeEnv.rootDeviceEnvironments[i]->getHelper(); switch (csrType) { case CSR_HW: @@ -267,10 +269,9 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsS expectedHwInfo.featureTable = {}; expectedHwInfo.workaroundTable = {}; expectedHwInfo.gtSystemInfo = {}; - hardwareInfoSetup[expectedHwInfo.platform.eProductFamily](&expectedHwInfo, true, 0x0); + hardwareInfoSetup[expectedHwInfo.platform.eProductFamily](&expectedHwInfo, true, 0x0, compilerProductHelper); productHelper.configureHardwareCustom(&expectedHwInfo, nullptr); - const auto &compilerProductHelper = exeEnv.rootDeviceEnvironments[i]->getHelper(); compilerProductHelper.setProductConfigForHwInfo(expectedHwInfo, deviceAot.aotConfig); expectedHwInfo.platform.usDeviceID = deviceAot.deviceIds->front(); @@ -338,6 +339,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknown for (auto i = 0u; i < expectedDevices; i++) { hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo(); auto &productHelper = exeEnv.rootDeviceEnvironments[i]->getProductHelper(); + auto &compilerProductHelper = exeEnv.rootDeviceEnvironments[i]->getHelper(); switch (csrType) { case CSR_HW: @@ -362,7 +364,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknown baseHwInfo.featureTable = {}; baseHwInfo.workaroundTable = {}; baseHwInfo.gtSystemInfo = {}; - hardwareInfoSetup[baseHwInfo.platform.eProductFamily](&baseHwInfo, true, 0x0); + hardwareInfoSetup[baseHwInfo.platform.eProductFamily](&baseHwInfo, true, 0x0, compilerProductHelper); productHelper.configureHardwareCustom(&baseHwInfo, nullptr); EXPECT_EQ(0, memcmp(&baseHwInfo.platform, &hwInfo->platform, sizeof(PLATFORM))); diff --git a/shared/test/unit_test/command_stream/tbx_command_stream_receiver_tests_xehp_and_later.cpp b/shared/test/unit_test/command_stream/tbx_command_stream_receiver_tests_xehp_and_later.cpp index 786af3266a..e1c0cfc1fb 100644 --- a/shared/test/unit_test/command_stream/tbx_command_stream_receiver_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/command_stream/tbx_command_stream_receiver_tests_xehp_and_later.cpp @@ -6,6 +6,7 @@ */ #include "shared/source/command_stream/tbx_command_stream_receiver_hw.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/memory_manager/memory_banks.h" #include "shared/source/memory_manager/memory_pool.h" #include "shared/source/memory_manager/physical_address_allocator.h" @@ -22,7 +23,8 @@ struct XeHPAndLaterTbxCommandStreamReceiverTests : DeviceFixture, ::testing::Tes template void setUpImpl() { hardwareInfo = *defaultHwInfo; - hardwareInfoSetup[hardwareInfo.platform.eProductFamily](&hardwareInfo, true, 0); + auto compilerProductHelper = CompilerProductHelper::create(hardwareInfo.platform.eProductFamily); + hardwareInfoSetup[hardwareInfo.platform.eProductFamily](&hardwareInfo, true, 0, *compilerProductHelper); hardwareInfo.gtSystemInfo.MultiTileArchInfo.IsValid = true; DeviceFixture::setUpImpl(&hardwareInfo); } diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index 05502ede36..ffc327c7cf 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -7,6 +7,7 @@ #include "shared/source/device/device.h" #include "shared/source/gmm_helper/gmm.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/driver_model_type.h" #include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/driver_info.h" @@ -748,7 +749,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenDebuggableOsContextWhenDeviceCrea ultHwConfig.useFirstSubmissionInitDevice = true; auto hwInfo = *defaultHwInfo; - hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0); + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); + hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0, *compilerProductHelper); MockExecutionEnvironment executionEnvironment(&hwInfo); executionEnvironment.memoryManager.reset(new MockMemoryManagerWithDebuggableOsContext(executionEnvironment)); @@ -766,7 +768,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, whenDeviceCreatesEnginesThenDeviceIsIn ultHwConfig.useFirstSubmissionInitDevice = true; auto hwInfo = *defaultHwInfo; - hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0); + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); + hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, true, 0, *compilerProductHelper); MockExecutionEnvironment executionEnvironment(&hwInfo); executionEnvironment.incRefInternal(); 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 c5a39f3c0f..dd43d39e16 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -19,8 +21,8 @@ using namespace NEO; using EhlProductHelper = ProductHelperTest; EHLTEST_F(EhlProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) { - - hardwareInfoSetup[productFamily](&pInHwInfo, false, 0x100040008); + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); + hardwareInfoSetup[productFamily](&pInHwInfo, false, 0x100040008, compilerProductHelper); EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler); EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcPreemption); EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme); @@ -30,6 +32,7 @@ EHLTEST_F(EhlProductHelper, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTabl bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; FeatureTable &featureTable = pInHwInfo.featureTable; WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable; @@ -39,7 +42,7 @@ EHLTEST_F(EhlProductHelper, givenBoolWhenCallEhlHardwareInfoSetupThenFeatureTabl gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, 0x100040008); + hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, 0x100040008, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); 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 47c3d535a2..3a4a3aafe5 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -21,11 +23,12 @@ using IcllpProductHelper = ProductHelperTest; ICLLPTEST_F(IcllpProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -59,6 +62,7 @@ ICLLPTEST_F(IcllpProductHelper, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatu bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; FeatureTable &featureTable = pInHwInfo.featureTable; WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable; @@ -69,7 +73,7 @@ ICLLPTEST_F(IcllpProductHelper, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatu gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); 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 51a97f8cc0..d7b82be906 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -20,11 +22,12 @@ using LkfProductHelper = ProductHelperTest; LKFTEST_F(LkfProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -33,8 +36,9 @@ LKFTEST_F(LkfProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExp LKFTEST_F(LkfProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); uint64_t config = 0x100080008; - hardwareInfoSetup[productFamily](&pInHwInfo, false, config); + hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper); EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler); EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcPreemption); EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme); @@ -44,6 +48,7 @@ LKFTEST_F(LkfProductHelper, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTabl bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; FeatureTable &featureTable = pInHwInfo.featureTable; WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable; @@ -55,7 +60,7 @@ LKFTEST_F(LkfProductHelper, givenBoolWhenCallLkfHardwareInfoSetupThenFeatureTabl gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); 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 d775a8b8c7..dfc49f159a 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 @@ -7,6 +7,7 @@ #include "shared/source/gen12lp/hw_cmds_adln.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -25,6 +26,7 @@ ADLNTEST_F(AdlnHwInfo, givenBoolWhenCallAdlnHardwareInfoSetupThenFeatureTableAnd static bool boolValue[]{ true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -35,7 +37,7 @@ ADLNTEST_F(AdlnHwInfo, givenBoolWhenCallAdlnHardwareInfoSetupThenFeatureTableAnd gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, *compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); @@ -114,4 +116,4 @@ ADLNTEST_F(AdlnProductHelper, givenAdlnPlatformWhenAskingIfWAIsRequiredThenRetur auto hwInfo = *defaultHwInfo; EXPECT_TRUE(productHelper->pipeControlWARequired(hwInfo)); -} \ No newline at end of file +} diff --git a/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp b/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp index 26040295d9..7825861ff9 100644 --- a/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp +++ b/shared/test/unit_test/gen12lp/adlp/linux/product_helper_tests_adlp.cpp @@ -7,6 +7,7 @@ #include "shared/source/gen12lp/hw_cmds_adlp.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/os_interface.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/gtest_helpers.h" @@ -53,8 +54,9 @@ ADLPTEST_F(AdlpProductHelperLinux, GivenInvalidDeviceIdWhenConfiguringHwInfoThen ADLPTEST_F(AdlpProductHelperLinux, givenAdlpConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - ADLP::setupHardwareInfoBase(&hwInfo, false); + ADLP::setupHardwareInfoBase(&hwInfo, false, *compilerProductHelper); EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); @@ -66,82 +68,13 @@ template using AdlpHwInfoLinux = ::testing::Test; using adlpConfigTestTypes = ::testing::Types; TYPED_TEST_CASE(AdlpHwInfoLinux, adlpConfigTestTypes); -TYPED_TEST(AdlpHwInfoLinux, givenAdlpConfigWhenSetupHardwareInfoThenGtSystemInfoAndWaAndFtrTablesAreSetCorrect) { - auto executionEnvironment = std::make_unique(); - executionEnvironment->prepareRootDeviceEnvironments(1); - executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get()); - executionEnvironment->rootDeviceEnvironments[0]->initGmm(); - - DrmMock drm(*executionEnvironment->rootDeviceEnvironments[0]); - DeviceDescriptor device = {0, &TypeParam::hwInfo, &TypeParam::setupHardwareInfo}; - - int ret = drm.setupHardwareInfo(&device, false); - { - const auto >SystemInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->gtSystemInfo; - const auto &featureTable = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->featureTable; - const auto &workaroundTable = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->workaroundTable; - - EXPECT_EQ(ret, 0); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); - - EXPECT_FALSE(featureTable.flags.ftrL3IACoherency); - EXPECT_FALSE(featureTable.flags.ftrPPGTT); - EXPECT_FALSE(featureTable.flags.ftrSVM); - EXPECT_FALSE(featureTable.flags.ftrIA32eGfxPTEs); - EXPECT_FALSE(featureTable.flags.ftrStandardMipTailFormat); - EXPECT_FALSE(featureTable.flags.ftrTranslationTable); - EXPECT_FALSE(featureTable.flags.ftrUserModeTranslationTable); - EXPECT_FALSE(featureTable.flags.ftrTileMappedResource); - EXPECT_FALSE(featureTable.flags.ftrFbc); - EXPECT_FALSE(featureTable.flags.ftrTileY); - EXPECT_FALSE(featureTable.flags.ftrAstcHdr2D); - EXPECT_FALSE(featureTable.flags.ftrAstcLdr2D); - - EXPECT_FALSE(featureTable.flags.ftrGpGpuMidBatchPreempt); - EXPECT_FALSE(featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); - - EXPECT_FALSE(workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface); - EXPECT_FALSE(workaroundTable.flags.waUntypedBufferCompression); - } - ret = drm.setupHardwareInfo(&device, true); - { - const auto >SystemInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->gtSystemInfo; - const auto &featureTable = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->featureTable; - const auto &workaroundTable = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo()->workaroundTable; - - EXPECT_EQ(ret, 0); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); - - EXPECT_TRUE(featureTable.flags.ftrL3IACoherency); - EXPECT_TRUE(featureTable.flags.ftrPPGTT); - EXPECT_TRUE(featureTable.flags.ftrSVM); - EXPECT_TRUE(featureTable.flags.ftrIA32eGfxPTEs); - EXPECT_TRUE(featureTable.flags.ftrStandardMipTailFormat); - EXPECT_TRUE(featureTable.flags.ftrTranslationTable); - EXPECT_TRUE(featureTable.flags.ftrUserModeTranslationTable); - EXPECT_TRUE(featureTable.flags.ftrTileMappedResource); - EXPECT_TRUE(featureTable.flags.ftrFbc); - EXPECT_FALSE(featureTable.flags.ftrTileY); - EXPECT_TRUE(featureTable.flags.ftrAstcHdr2D); - EXPECT_TRUE(featureTable.flags.ftrAstcLdr2D); - - EXPECT_TRUE(featureTable.flags.ftrGpGpuMidBatchPreempt); - EXPECT_TRUE(featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); - - EXPECT_TRUE(workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface); - EXPECT_TRUE(workaroundTable.flags.waUntypedBufferCompression); - } -} TYPED_TEST(AdlpHwInfoLinux, givenSliceCountZeroWhenSetupHardwareInfoThenNotZeroValuesSetInGtSystemInfo) { - HardwareInfo hwInfo = {}; + HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); hwInfo.gtSystemInfo = {0}; - TypeParam::setupHardwareInfo(&hwInfo, false); + TypeParam::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_NE(0u, hwInfo.gtSystemInfo.SliceCount); EXPECT_NE(0u, hwInfo.gtSystemInfo.SubSliceCount); 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 674a307ab1..8c09af965d 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 @@ -7,6 +7,7 @@ #include "shared/source/gen12lp/hw_cmds_adlp.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -25,6 +26,7 @@ ADLPTEST_F(AdlpHwInfo, givenBoolWhenCallAdlpHardwareInfoSetupThenFeatureTableAnd static bool boolValue[]{ true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -35,7 +37,7 @@ ADLPTEST_F(AdlpHwInfo, givenBoolWhenCallAdlpHardwareInfoSetupThenFeatureTableAnd gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, *compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); @@ -129,4 +131,4 @@ ADLPTEST_F(AdlpProductHelper, givenA0SteppingAndAdlpPlatformWhenAskingIfWAIsRequ EXPECT_EQ(paramBool, productHelper->pipeControlWARequired(hwInfo)); } -} \ No newline at end of file +} 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 77ec99bd9f..393b724976 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 @@ -7,6 +7,7 @@ #include "shared/source/gen12lp/hw_cmds_adls.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -28,6 +29,7 @@ ADLSTEST_F(AdlsHwInfo, givenBoolWhenCallAdlsHardwareInfoSetupThenFeatureTableAnd GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); uint64_t config = 0x100020016; for (auto setParamBool : boolValue) { @@ -35,7 +37,7 @@ ADLSTEST_F(AdlsHwInfo, givenBoolWhenCallAdlsHardwareInfoSetupThenFeatureTableAnd gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, *compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); @@ -124,4 +126,4 @@ ADLSTEST_F(AdlsProductHelper, givenA0SteppingAndAdlsPlatformWhenAskingIfWAIsRequ EXPECT_EQ(paramBool, productHelper->pipeControlWARequired(hwInfo)); } -} \ No newline at end of file +} diff --git a/shared/test/unit_test/gen12lp/dg1/hw_info_tests_dg1.cpp b/shared/test/unit_test/gen12lp/dg1/hw_info_tests_dg1.cpp index 1b1e94e483..ff27f57bc2 100644 --- a/shared/test/unit_test/gen12lp/dg1/hw_info_tests_dg1.cpp +++ b/shared/test/unit_test/gen12lp/dg1/hw_info_tests_dg1.cpp @@ -1,10 +1,11 @@ /* - * Copyright (C) 2020-2022 Intel Corporation + * Copyright (C) 2020-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -20,11 +21,12 @@ TYPED_TEST_CASE(Dg1HwInfoTests, dg1TestTypes); TYPED_TEST(Dg1HwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValueOfLocalMemoryFeature) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); FeatureTable &featureTable = hwInfo.featureTable; EXPECT_FALSE(featureTable.flags.ftrLocalMemory); - TypeParam::setupHardwareInfo(&hwInfo, false); + TypeParam::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_FALSE(featureTable.flags.ftrLocalMemory); - TypeParam::setupHardwareInfo(&hwInfo, true); + TypeParam::setupHardwareInfo(&hwInfo, true, *compilerProductHelper); EXPECT_TRUE(featureTable.flags.ftrLocalMemory); -} \ No newline at end of file +} 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 34119f7f12..c4a033bde8 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 @@ -6,6 +6,7 @@ */ #include "shared/source/gen12lp/hw_cmds_dg1.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -23,11 +24,12 @@ using Dg1HwInfo = ::testing::Test; DG1TEST_F(Dg1HwInfo, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config, *compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -38,6 +40,7 @@ DG1TEST_F(Dg1HwInfo, givenBoolWhenCallDg1HardwareInfoSetupThenFeatureTableAndWor bool boolValue[]{ true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -48,7 +51,7 @@ DG1TEST_F(Dg1HwInfo, givenBoolWhenCallDg1HardwareInfoSetupThenFeatureTableAndWor gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, *compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); 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 b161e23dcd..a28427f395 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 @@ -28,6 +28,7 @@ RKLTEST_F(RklHwInfo, givenBoolWhenCallRklHardwareInfoSetupThenFeatureTableAndWor bool boolValue[]{ true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -38,7 +39,7 @@ RKLTEST_F(RklHwInfo, givenBoolWhenCallRklHardwareInfoSetupThenFeatureTableAndWor gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, *compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); 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 d7945573f8..a99ae9b684 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 @@ -7,6 +7,7 @@ #include "shared/source/gen12lp/hw_cmds_tgllp.h" #include "shared/source/gen12lp/hw_info_gen12lp.h" +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/device_factory.h" #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" @@ -27,11 +28,12 @@ using TgllpHwInfo = ::testing::Test; TGLLPTEST_F(TgllpHwInfo, givenHwInfoErrorneousConfigStringThenThrow) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&hwInfo, false, config, *compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -40,19 +42,20 @@ TGLLPTEST_F(TgllpHwInfo, givenHwInfoErrorneousConfigStringThenThrow) { TGLLPTEST_F(TgllpHwInfo, whenUsingCorrectConfigValueThenCorrectHwInfoIsReturned) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; uint64_t config = 0x100060010; gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, config); + hardwareInfoSetup[productFamily](&hwInfo, false, config, *compilerProductHelper); EXPECT_EQ(1u, gtSystemInfo.SliceCount); EXPECT_EQ(6u, gtSystemInfo.DualSubSliceCount); config = 0x100020010; gtSystemInfo = {0}; - hardwareInfoSetup[productFamily](&hwInfo, false, config); + hardwareInfoSetup[productFamily](&hwInfo, false, config, *compilerProductHelper); EXPECT_EQ(1u, gtSystemInfo.SliceCount); EXPECT_EQ(2u, gtSystemInfo.DualSubSliceCount); } @@ -61,6 +64,7 @@ TGLLPTEST_F(TgllpHwInfo, givenBoolWhenCallTgllpHardwareInfoSetupThenFeatureTable static bool boolValue[]{ true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -75,7 +79,7 @@ TGLLPTEST_F(TgllpHwInfo, givenBoolWhenCallTgllpHardwareInfoSetupThenFeatureTable gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, *compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); @@ -116,9 +120,10 @@ TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeForTgllpProductFa TGLLPTEST_F(TgllpHwInfo, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); uint64_t config = 0x100060010; - hardwareInfoSetup[productFamily](&hwInfo, false, config); + hardwareInfoSetup[productFamily](&hwInfo, false, config, *compilerProductHelper); EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler); EXPECT_FALSE(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption); EXPECT_FALSE(hwInfo.capabilityTable.supportsVme); 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 a320841aff..f2959e9d32 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 @@ -5,6 +5,8 @@ * */ +#include "shared/source/execution_environment/execution_environment.h" +#include "shared/source/execution_environment/root_device_environment.h" #include "shared/source/gen8/hw_cmds_bdw.h" #include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/os_interface/hw_info_config.h" @@ -21,12 +23,12 @@ using namespace NEO; using BdwProductHelper = ProductHelperTest; BDWTEST_F(BdwProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { - + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -42,6 +44,7 @@ BDWTEST_F(BdwProductHelper, givenBoolWhenCallBdwHardwareInfoSetupThenFeatureTabl bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; FeatureTable &featureTable = pInHwInfo.featureTable; WorkaroundTable &workaroundTable = pInHwInfo.workaroundTable; @@ -52,7 +55,7 @@ BDWTEST_F(BdwProductHelper, givenBoolWhenCallBdwHardwareInfoSetupThenFeatureTabl gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&pInHwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrL3IACoherency); EXPECT_EQ(setParamBool, featureTable.flags.ftrPPGTT); @@ -71,8 +74,9 @@ BDWTEST_F(BdwProductHelper, givenBoolWhenCallBdwHardwareInfoSetupThenFeatureTabl BDWTEST_F(BdwProductHelper, givenProductHelperStringThenAfterSetupResultingVmeIsDisabled) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); uint64_t config = 0x0; - hardwareInfoSetup[productFamily](&pInHwInfo, false, config); + hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper); EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler); EXPECT_FALSE(pInHwInfo.capabilityTable.ftrSupportsVmeAvcPreemption); EXPECT_FALSE(pInHwInfo.capabilityTable.supportsVme); 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 1652ec8b29..871558e7c6 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -21,11 +23,12 @@ using BxtProductHelper = ProductHelperTest; BXTTEST_F(BxtProductHelper, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -42,6 +45,7 @@ BXTTEST_F(BxtProductHelper, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTabl 0x100030006}; bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); HardwareInfo hwInfo = *defaultHwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; @@ -55,7 +59,7 @@ BXTTEST_F(BxtProductHelper, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTabl featureTable = {}; workaroundTable = {}; platform.usRevId = 9; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); 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 e614275490..d461e2acf8 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 @@ -5,6 +5,8 @@ * */ +#include "shared/source/execution_environment/execution_environment.h" +#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/os_interface/hw_info_config.h" @@ -26,11 +28,12 @@ CFLTEST_F(CflProductHelper, whenGettingDefaultRevisionIdThen9IsReturned) { CFLTEST_F(CflProductHelper, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -50,6 +53,7 @@ CFLTEST_F(CflProductHelper, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTabl 0x100030006}; bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); HardwareInfo hwInfo = *defaultHwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; @@ -61,7 +65,7 @@ CFLTEST_F(CflProductHelper, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTabl gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); 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 9405939bed..7bb001fb6f 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -21,12 +23,13 @@ using GlkProductHelper = ProductHelperTest; GLKTEST_F(GlkProductHelper, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; gtSystemInfo = {0}; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -44,6 +47,7 @@ GLKTEST_F(GlkProductHelper, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTabl bool boolValue[]{ true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -54,7 +58,7 @@ GLKTEST_F(GlkProductHelper, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTabl gtSystemInfo = {0}; featureTable = {}; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); 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 4d14d62965..e4edf0d5a6 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -24,11 +26,12 @@ KBLTEST_F(KblProductHelper, whenGettingDefaultRevisionIdThen9IsReturned) { KBLTEST_F(KblProductHelper, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; uint64_t config = 0xdeadbeef; gtSystemInfo = {0}; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -48,6 +51,7 @@ KBLTEST_F(KblProductHelper, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTabl 0x100030006}; bool boolValue[]{ true, false}; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); HardwareInfo hwInfo = *defaultHwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; @@ -61,7 +65,7 @@ KBLTEST_F(KblProductHelper, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTabl featureTable = {}; workaroundTable = {}; platform.usRevId = 9; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); @@ -87,7 +91,7 @@ KBLTEST_F(KblProductHelper, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTabl platform.usRevId = 1; workaroundTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, true, config); + hardwareInfoSetup[productFamily](&hwInfo, true, config, compilerProductHelper); EXPECT_EQ(true, workaroundTable.flags.waDisableLSQCROPERFforOCL); EXPECT_EQ(true, workaroundTable.flags.waEncryptedEdramOnlyPartials); diff --git a/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp b/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp index 5c12a8c205..d08ba6f84b 100644 --- a/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp +++ b/shared/test/unit_test/gen9/skl/linux/product_helper_tests_skl.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/test/common/helpers/gtest_helpers.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/unit_test/os_interface/linux/product_helper_linux_tests.h" @@ -193,10 +194,11 @@ TYPED_TEST(SklHwInfoTests, WhenGtIsSetupThenGtSystemInfoIsCorrect) { TYPED_TEST(SklHwInfoTests, givenGTSystemInfoTypeWhenConfigureHardwareCustomThenSliceCountDontChange) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); auto osInterface = std::unique_ptr(new OSInterface()); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - TypeParam::setupHardwareInfo(&hwInfo, false); + TypeParam::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); auto sliceCount = gtSystemInfo.SliceCount; auto productHelper = ProductHelper::create(PRODUCT_FAMILY::IGFX_SKYLAKE); 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 32b52c5843..9250d0a4a4 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 @@ -5,6 +5,8 @@ * */ +#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/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -24,11 +26,12 @@ SKLTEST_F(SklProductHelper, whenGettingDefaultRevisionIdThen9IsReturned) { SKLTEST_F(SklProductHelper, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned) { + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = pInHwInfo.gtSystemInfo; gtSystemInfo = {0}; uint64_t config = 0xdeadbeef; - EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config)); + EXPECT_ANY_THROW(hardwareInfoSetup[productFamily](&pInHwInfo, false, config, compilerProductHelper)); EXPECT_EQ(0u, gtSystemInfo.SliceCount); EXPECT_EQ(0u, gtSystemInfo.SubSliceCount); EXPECT_EQ(0u, gtSystemInfo.DualSubSliceCount); @@ -50,6 +53,7 @@ SKLTEST_F(SklProductHelper, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTabl true, false}; HardwareInfo hwInfo = *defaultHwInfo; + auto &compilerProductHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper(); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -62,7 +66,7 @@ SKLTEST_F(SklProductHelper, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTabl featureTable = {}; workaroundTable = {}; pPlatform.usRevId = 9; - hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config); + hardwareInfoSetup[productFamily](&hwInfo, setParamBool, config, compilerProductHelper); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuMidBatchPreempt); EXPECT_EQ(setParamBool, featureTable.flags.ftrGpGpuThreadGroupLevelPreempt); @@ -95,7 +99,7 @@ SKLTEST_F(SklProductHelper, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTabl workaroundTable = {}; featureTable = {}; - hardwareInfoSetup[productFamily](&hwInfo, true, config); + hardwareInfoSetup[productFamily](&hwInfo, true, config, compilerProductHelper); EXPECT_EQ(true, workaroundTable.flags.waCompressedResourceRequiresConstVA21); EXPECT_EQ(true, workaroundTable.flags.waDisablePerCtxtPreemptionGranularityControl); diff --git a/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp index 97032f9453..23cac7672a 100644 --- a/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_system_info_tests.cpp @@ -61,7 +61,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoFalseThenSystem DrmMockToQuerySystemInfo drm(*executionEnvironment->rootDeviceEnvironments[0]); HardwareInfo hwInfo = *defaultHwInfo; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo}; ::testing::internal::CaptureStdout(); @@ -130,7 +130,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoFailsThenSystem DrmMockEngine drm(*executionEnvironment->rootDeviceEnvironments[0]); HardwareInfo hwInfo = *defaultHwInfo; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo}; ::testing::internal::CaptureStdout(); @@ -154,7 +154,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoSucceedsThenSys HardwareInfo hwInfo = *defaultHwInfo; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo}; int ret = drm.setupHardwareInfo(&device, false); @@ -194,7 +194,7 @@ TEST(DrmSystemInfoTest, givenSetupHardwareInfoWhenQuerySystemInfoSucceedsThenSys auto expectedMaxSubslicesSupported = dummyDeviceBlobData[5]; auto expectedMaxEusPerSubsliceSupported = dummyDeviceBlobData[8]; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo}; int ret = drm.setupHardwareInfo(&device, false); @@ -221,7 +221,7 @@ TEST(DrmSystemInfoTest, givenZeroBankCountWhenCreatingSystemInfoThenUseDualSubsl HardwareInfo hwInfo = *defaultHwInfo; hwInfo.gtSystemInfo.L3BankCount = 0; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo}; int ret = drm.setupHardwareInfo(&device, false); @@ -246,7 +246,7 @@ TEST(DrmSystemInfoTest, givenNonZeroBankCountWhenCreatingSystemInfoThenUseDualSu HardwareInfo hwInfo = *defaultHwInfo; hwInfo.gtSystemInfo.L3BankCount = 5; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, &hwInfo, setupHardwareInfo}; int ret = drm.setupHardwareInfo(&device, false); diff --git a/shared/test/unit_test/os_interface/linux/drm_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_tests.cpp index 1a46391c35..6ddc0e078f 100644 --- a/shared/test/unit_test/os_interface/linux/drm_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_tests.cpp @@ -935,7 +935,7 @@ TEST(DrmQueryTest, GivenDrmWhenSetupHardwareInfoCalledThenCorrectMaxValuesInGtSy drm.storedSSVal = 6; hwInfo->gtSystemInfo.SliceCount = 2; - auto setupHardwareInfo = [](HardwareInfo *, bool) {}; + auto setupHardwareInfo = [](HardwareInfo *, bool, const CompilerProductHelper &) {}; DeviceDescriptor device = {0, hwInfo, setupHardwareInfo}; drm.ioctlHelper.reset(); diff --git a/shared/test/unit_test/xe_hpc_core/pvc/hw_info_tests_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/hw_info_tests_pvc.cpp index bb98e5f185..49bf303627 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/hw_info_tests_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/hw_info_tests_pvc.cpp @@ -5,6 +5,7 @@ * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/constants.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/unified_memory/usm_memory_support.h" @@ -60,8 +61,9 @@ PVCTEST_F(PvcConfigHwInfoTests, givenPvcDeviceIdsAndRevisionsWhenCheckingConfigs } PVCTEST_F(PvcConfigHwInfoTests, givenPvcConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - PVC::setupHardwareInfoBase(&hwInfo, false); + PVC::setupHardwareInfoBase(&hwInfo, false, *compilerProductHelper); EXPECT_EQ(128u, gtSystemInfo.MaxFillRate); EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); @@ -93,8 +95,9 @@ PVCTEST_F(PvcConfigHwInfoTests, givenPvcConfigWhenSetupMultiTileInfoBaseThenGtSy PVCTEST_F(PvcConfigHwInfoTests, givenPvcHwConfigWhenSetupHardwareInfoThenSharedSystemMemCapabilitiesIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); auto &capabilityTable = hwInfo.capabilityTable; - PvcHwConfig::setupHardwareInfo(&hwInfo, false); + PvcHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); uint64_t expectedSharedSystemMemCapabilities = (UNIFIED_SHARED_MEMORY_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS | UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS); EXPECT_EQ(expectedSharedSystemMemCapabilities, capabilityTable.sharedSystemMemCapabilities); } 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 24ca1e0555..4fae579bde 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 @@ -8,6 +8,7 @@ #include "shared/source/command_stream/stream_properties.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/gfx_core_helper.h" #include "shared/source/helpers/product_config_helper.h" @@ -149,8 +150,9 @@ DG2TEST_F(ProductHelperTestDg2, whenGettingAubstreamProductFamilyThenProperEnumV DG2TEST_F(ProductHelperTestDg2, givenDg2ConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - Dg2HwConfig::setupHardwareInfoBase(&hwInfo, false); + Dg2HwConfig::setupHardwareInfoBase(&hwInfo, false, *compilerProductHelper); EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); @@ -164,9 +166,10 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2ConfigWhenSetupHardwareInfoBaseThenGtSys DG2TEST_F(ProductHelperTestDg2, givenDg2ConfigWhenSetupHardwareInfoThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - Dg2HwConfig::setupHardwareInfo(&hwInfo, false); + Dg2HwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); } diff --git a/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp index 4aa189959c..96e0f7176c 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/hw_info_tests_mtl.cpp @@ -1,10 +1,11 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/compiler_product_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/default_hw_info.h" @@ -17,6 +18,7 @@ using MtlHwInfoTests = ::testing::Test; MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValues) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); FeatureTable &featureTable = hwInfo.featureTable; WorkaroundTable &workaroundTable = hwInfo.workaroundTable; @@ -30,7 +32,7 @@ MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFa EXPECT_FALSE(workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface); EXPECT_FALSE(workaroundTable.flags.waUntypedBufferCompression); - MtlHwConfig::setupHardwareInfo(&hwInfo, false); + MtlHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_FALSE(featureTable.flags.ftrLocalMemory); EXPECT_FALSE(featureTable.flags.ftrFlatPhysCCS); EXPECT_FALSE(featureTable.flags.ftrLinearCCS); @@ -41,7 +43,7 @@ MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFa EXPECT_FALSE(workaroundTable.flags.wa4kAlignUVOffsetNV12LinearSurface); EXPECT_FALSE(workaroundTable.flags.waUntypedBufferCompression); - MtlHwConfig::setupHardwareInfo(&hwInfo, true); + MtlHwConfig::setupHardwareInfo(&hwInfo, true, *compilerProductHelper); EXPECT_FALSE(featureTable.flags.ftrLocalMemory); EXPECT_FALSE(featureTable.flags.ftrFlatPhysCCS); EXPECT_TRUE(featureTable.flags.ftrLinearCCS); @@ -55,20 +57,22 @@ MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFa MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoWithSetupFeatureTableFlagTrueOrFalseIsCalledThenFeatureTableHasCorrectValueOfFtrLinearCCS) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); FeatureTable &featureTable = hwInfo.featureTable; EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - MtlHwConfig::setupHardwareInfo(&hwInfo, false); + MtlHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_FALSE(featureTable.flags.ftrLinearCCS); - MtlHwConfig::setupHardwareInfo(&hwInfo, true); + MtlHwConfig::setupHardwareInfo(&hwInfo, true, *compilerProductHelper); EXPECT_TRUE(featureTable.flags.ftrLinearCCS); } MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoThenCorrectValuesOfCCSAndMultiTileInfoAreSet) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - MtlHwConfig::setupHardwareInfo(&hwInfo, false); + MtlHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_FALSE(gtSystemInfo.MultiTileArchInfo.IsValid); @@ -78,10 +82,12 @@ MTLTEST_F(MtlHwInfoTests, WhenSetupHardwareInfoThenCorrectValuesOfCCSAndMultiTil } MTLTEST_F(MtlHwInfoTests, GivenEmptyHwInfoForUnitTestsWhenSetupHardwareInfoIsCalledThenNonZeroValuesAreSet) { - HardwareInfo hwInfoToSet; + HardwareInfo hwInfoToSet = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfoToSet.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfoToSet.gtSystemInfo; + gtSystemInfo = {}; - MtlHwConfig::setupHardwareInfo(&hwInfoToSet, false); + MtlHwConfig::setupHardwareInfo(&hwInfoToSet, false, *compilerProductHelper); EXPECT_GT_VAL(gtSystemInfo.SliceCount, 0u); EXPECT_GT_VAL(gtSystemInfo.SubSliceCount, 0u); 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 f1d6501f59..676ac7e845 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 @@ -27,8 +27,9 @@ using MtlProductHelper = ProductHelperTest; MTLTEST_F(MtlProductHelper, givenMtlConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - MtlHwConfig::setupHardwareInfoBase(&hwInfo, false); + MtlHwConfig::setupHardwareInfoBase(&hwInfo, false, *compilerProductHelper); EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); @@ -42,8 +43,9 @@ MTLTEST_F(MtlProductHelper, givenMtlConfigWhenSetupHardwareInfoBaseThenGtSystemI MTLTEST_F(MtlProductHelper, givenMtlConfigWhenSetupHardwareInfoThenGtSystemInfoHasNonZeroValues) { HardwareInfo hwInfo = *defaultHwInfo; + auto compilerProductHelper = CompilerProductHelper::create(hwInfo.platform.eProductFamily); GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - MtlHwConfig::setupHardwareInfo(&hwInfo, false); + MtlHwConfig::setupHardwareInfo(&hwInfo, false, *compilerProductHelper); EXPECT_GT(gtSystemInfo.SliceCount, 0u); EXPECT_GT(gtSystemInfo.SubSliceCount, 0u);