diff --git a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_pvc_and_later.inl b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_pvc_and_later.inl index 3dc6cf442b..0db882d6c1 100644 --- a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_pvc_and_later.inl +++ b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_pvc_and_later.inl @@ -19,7 +19,7 @@ namespace L0 { template void L0GfxCoreHelperHw::getAttentionBitmaskForSingleThreads(const std::vector &threads, const NEO::HardwareInfo &hwInfo, std::unique_ptr &bitmask, size_t &bitmaskSize) const { const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported; - const uint32_t numEuPerSubslice = hwInfo.gtSystemInfo.MaxEuPerSubSlice; + const uint32_t numEuPerSubslice = std::min(hwInfo.gtSystemInfo.MaxEuPerSubSlice, 8u); const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount); const uint32_t bytesPerEu = alignUp(numThreadsPerEu, 8) / 8; const uint32_t threadsSizePerSlice = numSubslicesPerSlice * numEuPerSubslice * bytesPerEu; diff --git a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_skl_to_icllp.inl b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_skl_to_icllp.inl index f3581c815b..d9734cbdb2 100644 --- a/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_skl_to_icllp.inl +++ b/level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_skl_to_icllp.inl @@ -23,7 +23,7 @@ void L0GfxCoreHelperHw::setAdditionalGroupProperty(ze_command_queue_grou template void L0GfxCoreHelperHw::getAttentionBitmaskForSingleThreads(const std::vector &threads, const NEO::HardwareInfo &hwInfo, std::unique_ptr &bitmask, size_t &bitmaskSize) const { const uint32_t numSubslicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported; - const uint32_t numEuPerSubslice = hwInfo.gtSystemInfo.MaxEuPerSubSlice; + const uint32_t numEuPerSubslice = std::min(hwInfo.gtSystemInfo.MaxEuPerSubSlice, 8u); const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount); const uint32_t bytesPerEu = alignUp(numThreadsPerEu, 8) / 8; const uint32_t threadsSizePerSlice = numSubslicesPerSlice * numEuPerSubslice * bytesPerEu; diff --git a/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp b/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp index ebfdd51520..222e820018 100644 --- a/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp @@ -128,7 +128,12 @@ HWTEST_F(L0GfxCoreHelperTest, givenSliceSubsliceEuAndThreadIdsWhenGettingBitmask }; auto hwInfo = *NEO::defaultHwInfo.get(); - MockExecutionEnvironment executionEnvironment; + const auto threadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount); + + hwInfo.gtSystemInfo.MaxEuPerSubSlice = 16u; + hwInfo.gtSystemInfo.EUCount = hwInfo.gtSystemInfo.MaxEuPerSubSlice * hwInfo.gtSystemInfo.SubSliceCount; + hwInfo.gtSystemInfo.ThreadCount = hwInfo.gtSystemInfo.EUCount * threadsPerEu; + MockExecutionEnvironment executionEnvironment(&hwInfo); auto &l0GfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper(); std::unique_ptr bitmask; @@ -137,8 +142,6 @@ HWTEST_F(L0GfxCoreHelperTest, givenSliceSubsliceEuAndThreadIdsWhenGettingBitmask uint32_t subslicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported; uint32_t subslice = subslicesPerSlice > 1 ? subslicesPerSlice - 1 : 0; - const auto threadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount); - auto releaseHelper = executionEnvironment.rootDeviceEnvironments[0]->getReleaseHelper(); auto bytesPerEu = releaseHelper ? Math::divideAndRoundUp(releaseHelper->getNumThreadsPerEu(), 8u) : 1u; diff --git a/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp index 04c63e4d29..983e41fa9a 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/debug_session_thread_tests.cpp @@ -1,10 +1,11 @@ /* - * Copyright (C) 2021-2023 Intel Corporation + * Copyright (C) 2021-2024 Intel Corporation * * SPDX-License-Identifier: MIT * */ +#include "shared/source/helpers/gfx_core_helper.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/helpers/gtest_helpers.h" #include "shared/test/common/mocks/mock_device.h" @@ -297,7 +298,7 @@ TEST(DebugSession, givenAllSlicesWhenGettingSingleThreadsThenCorrectThreadsAreRe auto debugSession = std::make_unique(config, &deviceImp); ze_device_thread_t physicalThread = {UINT32_MAX, 0, 0, 0}; - const uint32_t numSlices = hwInfo.gtSystemInfo.MaxSlicesSupported; + const uint32_t numSlices = neoDevice->getGfxCoreHelper().getHighestEnabledSlice(hwInfo); auto threads = debugSession->getSingleThreadsForDevice(0, physicalThread, hwInfo); diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp index 2f73ada96b..3f600781ad 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/prelim/test_debug_api_linux.cpp @@ -5707,7 +5707,9 @@ TEST_F(DebugApiLinuxTest, GivenSliceALLWhenCallingResumeThenSliceIdIsNotRemapped ze_device_thread_t thread = {}; thread.slice = UINT32_MAX; - for (uint32_t i = 0; i < device->getHwInfo().gtSystemInfo.MaxSlicesSupported; i++) { + const auto &hwInfo = device->getHwInfo(); + auto numSlices = neoDevice->getGfxCoreHelper().getHighestEnabledSlice(hwInfo); + for (uint32_t i = 0; i < numSlices; i++) { ze_device_thread_t singleThread = thread; singleThread.slice = i; sessionMock->allThreads[EuThread::ThreadId(0, singleThread)]->stopThread(1u); @@ -6306,7 +6308,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenHandlingAttEventThenAtt sessionMock->handleEvent(reinterpret_cast(data)); EXPECT_EQ(2u, sessionMock->newlyStoppedThreads.size()); - auto expectedThreadsToCheck = (hwInfo.capabilityTable.fusedEuEnabled && hwInfo.gtSystemInfo.MaxEuPerSubSlice != 8) ? 4u : 2u; + auto expectedThreadsToCheck = hwInfo.capabilityTable.fusedEuEnabled ? 4u : 2u; EXPECT_EQ(expectedThreadsToCheck, sessionMock->addThreadToNewlyStoppedFromRaisedAttentionCallCount); EXPECT_EQ(expectedThreadsToCheck, sessionMock->readSystemRoutineIdentFromMemoryCallCount); EXPECT_EQ(0u, sessionMock->readSystemRoutineIdentCallCount); diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp index 5e117fd18f..b4ccf4bd8b 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/xe/test_debug_api_linux_xe.cpp @@ -2093,7 +2093,7 @@ TEST_F(DebugApiLinuxTestXe, GivenSentInterruptWhenHandlingAttEventThenAttBitsAre sessionMock->handleEvent(reinterpret_cast(data)); EXPECT_EQ(1u, sessionMock->newlyStoppedThreads.size()); - auto expectedThreadsToCheck = (hwInfo.capabilityTable.fusedEuEnabled && hwInfo.gtSystemInfo.MaxEuPerSubSlice != 8) ? 2u : 1u; + auto expectedThreadsToCheck = hwInfo.capabilityTable.fusedEuEnabled ? 2u : 1u; EXPECT_EQ(expectedThreadsToCheck, sessionMock->addThreadToNewlyStoppedFromRaisedAttentionCallCount); EXPECT_EQ(expectedThreadsToCheck, sessionMock->readSystemRoutineIdentFromMemoryCallCount); EXPECT_EQ(0u, sessionMock->readSystemRoutineIdentCallCount); @@ -2302,4 +2302,4 @@ TEST(DebugSessionLinuxXeTest, GivenRootDebugSessionWhenCreateTileSessionCalledTh } } // namespace ult -} // namespace L0 \ No newline at end of file +} // namespace L0 diff --git a/shared/source/helpers/hw_info.cpp b/shared/source/helpers/hw_info.cpp index 711bd8e3d8..82a4b9a304 100644 --- a/shared/source/helpers/hw_info.cpp +++ b/shared/source/helpers/hw_info.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -10,6 +10,7 @@ #include "shared/source/command_stream/linear_stream.h" #include "shared/source/debug_settings/debug_settings_manager.h" #include "shared/source/helpers/gfx_core_helper.h" +#include "shared/source/release_helper/release_helper.h" #include @@ -128,4 +129,25 @@ aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo) { ? hwInfo.capabilityTable.defaultEngineType : static_cast(debugManager.flags.NodeOrdinal.get()); } +void setupDefaultGtSysInfo(HardwareInfo *hwInfo, const ReleaseHelper *releaseHelper) { + GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; + gtSysInfo->L3CacheSizeInKb = 1; + gtSysInfo->CCSInfo.IsValid = 1; + gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1; + gtSysInfo->CCSInfo.Instances.CCSEnableMask = 0b1; + // non-zero values for unit tests + if (gtSysInfo->SliceCount == 0) { + gtSysInfo->SliceCount = 2; + gtSysInfo->SubSliceCount = 8; + gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; + gtSysInfo->EUCount = 64; + + gtSysInfo->MaxEuPerSubSlice = gtSysInfo->EUCount / gtSysInfo->SubSliceCount; + gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount; + gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount; + gtSysInfo->MaxDualSubSlicesSupported = gtSysInfo->DualSubSliceCount; + gtSysInfo->L3BankCount = 1; + } + gtSysInfo->ThreadCount = gtSysInfo->EUCount * releaseHelper->getNumThreadsPerEu(); +} } // namespace NEO diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index 73886ee6f5..2307203b4f 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -169,5 +169,6 @@ bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwIn void setHwInfoValuesFromConfig(const uint64_t hwInfoConfig, HardwareInfo &hwInfoIn); bool parseHwInfoConfigString(const std::string &hwInfoConfigStr, uint64_t &hwInfoConfig); aub_stream::EngineType getChosenEngineType(const HardwareInfo &hwInfo); +void setupDefaultGtSysInfo(HardwareInfo *hwInfo, const ReleaseHelper *releaseHelper); } // namespace NEO diff --git a/shared/source/xe_hpc_core/hw_cmds_pvc.h b/shared/source/xe_hpc_core/hw_cmds_pvc.h index b53667e744..6e9c306e30 100644 --- a/shared/source/xe_hpc_core/hw_cmds_pvc.h +++ b/shared/source/xe_hpc_core/hw_cmds_pvc.h @@ -17,11 +17,6 @@ struct PVC : public XeHpcCoreFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - // Initial non-zero values for unit tests - static const uint32_t maxEuPerSubslice = 8; - static const uint32_t maxSlicesSupported = 8; - static const uint32_t maxSubslicesSupported = 64; - static const uint32_t maxDualSubslicesSupported = 64; static const RuntimeCapabilityTable capabilityTable; static constexpr uint32_t numberOfpartsInTileForConcurrentKernels = 8u; diff --git a/shared/source/xe_hpc_core/hw_info_pvc.cpp b/shared/source/xe_hpc_core/hw_info_pvc.cpp index aba0273e48..0fc348f0ce 100644 --- a/shared/source/xe_hpc_core/hw_info_pvc.cpp +++ b/shared/source/xe_hpc_core/hw_info_pvc.cpp @@ -135,21 +135,8 @@ void PVC::adjustHardwareInfo(HardwareInfo *hwInfo) { } void PVC::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * releaseHelper->getNumThreadsPerEu(); - gtSysInfo->MaxFillRate = 128; - gtSysInfo->TotalVsThreads = 336; - gtSysInfo->TotalHsThreads = 336; - gtSysInfo->TotalDsThreads = 336; - gtSysInfo->TotalGsThreads = 336; - gtSysInfo->TotalPsThreadsWindowerRange = 64; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->MaxEuPerSubSlice = PVC::maxEuPerSubslice; - gtSysInfo->MaxSlicesSupported = PVC::maxSlicesSupported; - gtSysInfo->MaxSubSlicesSupported = PVC::maxSubslicesSupported; - gtSysInfo->MaxDualSubSlicesSupported = PVC::maxDualSubslicesSupported; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; + setupDefaultGtSysInfo(hwInfo, releaseHelper); + setupHardwareInfoMultiTileBase(hwInfo, true); PVC::adjustHardwareInfo(hwInfo); @@ -181,39 +168,6 @@ const HardwareInfo PvcHwConfig::hwInfo = { GT_SYSTEM_INFO PvcHwConfig::gtSystemInfo = {0}; void PvcHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { PVC::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; - - // non-zero values for unit tests - if (gtSysInfo->SliceCount == 0) { - setupHardwareInfoMultiTileBase(hwInfo, true); - gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 8; - gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; - gtSysInfo->EUCount = 40; - gtSysInfo->MaxEuPerSubSlice = gtSysInfo->EUCount / gtSysInfo->SubSliceCount; - gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount; - gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount; - - gtSysInfo->L3CacheSizeInKb = 1; - gtSysInfo->L3BankCount = 1; - - gtSysInfo->CCSInfo.IsValid = true; - gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1; - gtSysInfo->CCSInfo.Instances.CCSEnableMask = 0b1; - - hwInfo->featureTable.ftrBcsInfo = 1; - gtSysInfo->IsDynamicallyPopulated = true; - for (uint32_t slice = 0; slice < gtSysInfo->SliceCount; slice++) { - gtSysInfo->SliceInfo[slice].Enabled = true; - } - } - - if (setupFeatureTableAndWorkaroundTable) { - PVC::setupFeatureAndWorkaroundTable(hwInfo); - } }; const HardwareInfo PVC::hwInfo = PvcHwConfig::hwInfo; diff --git a/shared/source/xe_hpg_core/hw_cmds_dg2.h b/shared/source/xe_hpg_core/hw_cmds_dg2.h index 605f9ed7f6..928da69b47 100644 --- a/shared/source/xe_hpg_core/hw_cmds_dg2.h +++ b/shared/source/xe_hpg_core/hw_cmds_dg2.h @@ -25,11 +25,6 @@ struct DG2 : public XeHpgCoreFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - // Initial non-zero values for unit tests - 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, const ReleaseHelper *releaseHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); diff --git a/shared/source/xe_hpg_core/hw_cmds_mtl.h b/shared/source/xe_hpg_core/hw_cmds_mtl.h index 572e9b4769..eb174bd9db 100644 --- a/shared/source/xe_hpg_core/hw_cmds_mtl.h +++ b/shared/source/xe_hpg_core/hw_cmds_mtl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,11 +16,6 @@ struct MTL : public XeHpgCoreFamily { static const HardwareInfo hwInfo; static FeatureTable featureTable; static WorkaroundTable workaroundTable; - // Initial non-zero values for unit tests - 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, const ReleaseHelper *releaseHelper); static void setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo); diff --git a/shared/source/xe_hpg_core/hw_info_arl.cpp b/shared/source/xe_hpg_core/hw_info_arl.cpp index d304d2e343..97f4db68e9 100644 --- a/shared/source/xe_hpg_core/hw_info_arl.cpp +++ b/shared/source/xe_hpg_core/hw_info_arl.cpp @@ -110,26 +110,14 @@ void ARL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { featureTable->flags.ftrCCSNode = true; featureTable->flags.ftrCCSRing = true; featureTable->flags.ftrTile64Optimization = true; + featureTable->ftrBcsInfo = 1; workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; workaroundTable->flags.waUntypedBufferCompression = true; }; void ARL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * releaseHelper->getNumThreadsPerEu(); - gtSysInfo->TotalPsThreadsWindowerRange = 64; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; - gtSysInfo->TotalVsThreads = 336; - gtSysInfo->TotalHsThreads = 336; - gtSysInfo->TotalDsThreads = 336; - gtSysInfo->TotalGsThreads = 336; - - gtSysInfo->CCSInfo.IsValid = true; - gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1; - gtSysInfo->CCSInfo.Instances.CCSEnableMask = 0b1; + setupDefaultGtSysInfo(hwInfo, releaseHelper); if (setupFeatureTableAndWorkaroundTable) { setupFeatureAndWorkaroundTable(hwInfo); @@ -146,30 +134,6 @@ const HardwareInfo ArlHwConfig::hwInfo = { GT_SYSTEM_INFO ArlHwConfig::gtSystemInfo = {0}; void ArlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { ARL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; - - // non-zero values for unit tests - if (gtSysInfo->SliceCount == 0) { - gtSysInfo->SliceCount = 1; - gtSysInfo->SubSliceCount = 2; - gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; - gtSysInfo->EUCount = 4; - gtSysInfo->MaxEuPerSubSlice = gtSysInfo->EUCount / gtSysInfo->SubSliceCount; - gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount; - gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount; - - gtSysInfo->L3BankCount = 1; - - hwInfo->featureTable.ftrBcsInfo = 1; - gtSysInfo->IsDynamicallyPopulated = true; - for (uint32_t slice = 0; slice < gtSysInfo->SliceCount; slice++) { - gtSysInfo->SliceInfo[slice].Enabled = true; - } - } - gtSysInfo->L3CacheSizeInKb = 1; if (setupFeatureTableAndWorkaroundTable) { ARL::setupFeatureAndWorkaroundTable(hwInfo); diff --git a/shared/source/xe_hpg_core/hw_info_dg2.cpp b/shared/source/xe_hpg_core/hw_info_dg2.cpp index a126a98887..a1c8035316 100644 --- a/shared/source/xe_hpg_core/hw_info_dg2.cpp +++ b/shared/source/xe_hpg_core/hw_info_dg2.cpp @@ -119,25 +119,13 @@ void DG2::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { featureTable->flags.ftrUnified3DMediaCompressionFormats = true; featureTable->flags.ftrTile64Optimization = true; + hwInfo->featureTable.ftrBcsInfo = 1; workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; }; void DG2::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * releaseHelper->getNumThreadsPerEu(); - gtSysInfo->TotalVsThreads = 336; - gtSysInfo->TotalHsThreads = 336; - gtSysInfo->TotalDsThreads = 336; - gtSysInfo->TotalGsThreads = 336; - gtSysInfo->TotalPsThreadsWindowerRange = 64; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->MaxEuPerSubSlice = DG2::maxEuPerSubslice; - gtSysInfo->MaxSlicesSupported = DG2::maxSlicesSupported; - gtSysInfo->MaxSubSlicesSupported = DG2::maxSubslicesSupported; - gtSysInfo->MaxDualSubSlicesSupported = DG2::maxDualSubslicesSupported; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; + setupDefaultGtSysInfo(hwInfo, releaseHelper); if (setupFeatureTableAndWorkaroundTable) { setupFeatureAndWorkaroundTable(hwInfo); @@ -153,42 +141,12 @@ const HardwareInfo Dg2HwConfig::hwInfo = { GT_SYSTEM_INFO Dg2HwConfig::gtSystemInfo = {0}; void Dg2HwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; - - // non-zero values for unit tests - if (gtSysInfo->SliceCount == 0) { - gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 8; - gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; - gtSysInfo->EUCount = 40; - gtSysInfo->MaxEuPerSubSlice = gtSysInfo->EUCount / gtSysInfo->SubSliceCount; - gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount; - gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount; - gtSysInfo->IsDynamicallyPopulated = true; - gtSysInfo->L3BankCount = 1; - } - gtSysInfo->L3CacheSizeInKb = 1; - - gtSysInfo->CCSInfo.IsValid = true; - gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1; - - hwInfo->featureTable.ftrBcsInfo = 1; - for (uint32_t slice = 0; slice < gtSysInfo->SliceCount; slice++) { - gtSysInfo->SliceInfo[slice].Enabled = true; - } - - if (setupFeatureTableAndWorkaroundTable) { - DG2::setupFeatureAndWorkaroundTable(hwInfo); - } + DG2::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); }; const HardwareInfo DG2::hwInfo = Dg2HwConfig::hwInfo; void setupDG2HardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper) { - DG2::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); Dg2HwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); } diff --git a/shared/source/xe_hpg_core/hw_info_mtl.cpp b/shared/source/xe_hpg_core/hw_info_mtl.cpp index 6cafd5c974..c59ba705be 100644 --- a/shared/source/xe_hpg_core/hw_info_mtl.cpp +++ b/shared/source/xe_hpg_core/hw_info_mtl.cpp @@ -111,30 +111,14 @@ void MTL::setupFeatureAndWorkaroundTable(HardwareInfo *hwInfo) { featureTable->flags.ftrCCSNode = true; featureTable->flags.ftrCCSRing = true; featureTable->flags.ftrTile64Optimization = true; + featureTable->ftrBcsInfo = 1; workaroundTable->flags.wa4kAlignUVOffsetNV12LinearSurface = true; workaroundTable->flags.waUntypedBufferCompression = true; }; void MTL::setupHardwareInfoBase(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->ThreadCount = gtSysInfo->EUCount * releaseHelper->getNumThreadsPerEu(); - gtSysInfo->TotalVsThreads = 336; - gtSysInfo->TotalHsThreads = 336; - gtSysInfo->TotalDsThreads = 336; - gtSysInfo->TotalGsThreads = 336; - gtSysInfo->TotalPsThreadsWindowerRange = 64; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->MaxEuPerSubSlice = MTL::maxEuPerSubslice; - gtSysInfo->MaxSlicesSupported = MTL::maxSlicesSupported; - gtSysInfo->MaxSubSlicesSupported = MTL::maxSubslicesSupported; - gtSysInfo->MaxDualSubSlicesSupported = MTL::maxDualSubslicesSupported; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; - - gtSysInfo->CCSInfo.IsValid = true; - gtSysInfo->CCSInfo.NumberOfCCSEnabled = 1; - gtSysInfo->CCSInfo.Instances.CCSEnableMask = 0b1; + setupDefaultGtSysInfo(hwInfo, releaseHelper); if (setupFeatureTableAndWorkaroundTable) { setupFeatureAndWorkaroundTable(hwInfo); @@ -151,30 +135,6 @@ const HardwareInfo MtlHwConfig::hwInfo = { GT_SYSTEM_INFO MtlHwConfig::gtSystemInfo = {0}; void MtlHwConfig::setupHardwareInfo(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper) { MTL::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, releaseHelper); - GT_SYSTEM_INFO *gtSysInfo = &hwInfo->gtSystemInfo; - gtSysInfo->CsrSizeInMb = 8; - gtSysInfo->IsL3HashModeEnabled = false; - gtSysInfo->IsDynamicallyPopulated = false; - - // non-zero values for unit tests - if (gtSysInfo->SliceCount == 0) { - gtSysInfo->SliceCount = 2; - gtSysInfo->SubSliceCount = 8; - gtSysInfo->DualSubSliceCount = gtSysInfo->SubSliceCount; - gtSysInfo->EUCount = 40; - gtSysInfo->MaxEuPerSubSlice = gtSysInfo->EUCount / gtSysInfo->SubSliceCount; - gtSysInfo->MaxSlicesSupported = gtSysInfo->SliceCount; - gtSysInfo->MaxSubSlicesSupported = gtSysInfo->SubSliceCount; - - gtSysInfo->L3BankCount = 1; - - hwInfo->featureTable.ftrBcsInfo = 1; - gtSysInfo->IsDynamicallyPopulated = true; - for (uint32_t slice = 0; slice < gtSysInfo->SliceCount; slice++) { - gtSysInfo->SliceInfo[slice].Enabled = true; - } - } - gtSysInfo->L3CacheSizeInKb = 1; if (setupFeatureTableAndWorkaroundTable) { MTL::setupFeatureAndWorkaroundTable(hwInfo); diff --git a/shared/test/unit_test/device/neo_device_tests.cpp b/shared/test/unit_test/device/neo_device_tests.cpp index 78370a9cb7..963f4f566c 100644 --- a/shared/test/unit_test/device/neo_device_tests.cpp +++ b/shared/test/unit_test/device/neo_device_tests.cpp @@ -260,7 +260,7 @@ HWTEST2_F(DeviceTest, whenAllocateRTDispatchGlobalsIsCalledAndRTStackAllocationF std::unique_ptr otherMemoryManager; otherMemoryManager = std::make_unique(*device->executionEnvironment); - static_cast(*otherMemoryManager).capacity = 50000000; + static_cast(*otherMemoryManager).capacity = MemoryConstants::pageSize; device->executionEnvironment->memoryManager.swap(otherMemoryManager); device->initializeRayTracing(5); @@ -1105,7 +1105,8 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTest, givenHwInfoWhenRequestedComputeUnitsUse const uint32_t multiplyFactor = productHelper.getThreadEuRatioForScratch(hwInfo) / 8u; const uint32_t numThreadsPerEu = (hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount) * multiplyFactor; - uint32_t expectedValue = hwInfo.gtSystemInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice * numThreadsPerEu; + + uint32_t expectedValue = productHelper.computeMaxNeededSubSliceSpace(hwInfo) * hwInfo.gtSystemInfo.MaxEuPerSubSlice * numThreadsPerEu; EXPECT_EQ(expectedValue, gfxCoreHelper.getComputeUnitsUsedForScratch(pDevice->getRootDeviceEnvironment())); EXPECT_EQ(expectedValue, pDevice->getDeviceInfo().computeUnitsUsedForScratch); 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 752b29a935..b1c254bad9 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 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022-2023 Intel Corporation + * Copyright (C) 2022-2024 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -88,15 +88,15 @@ PVCTEST_F(PvcConfigHwInfoTests, givenPvcConfigWhenSetupHardwareInfoBaseThenGtSys GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; PVC::setupHardwareInfoBase(&hwInfo, false, releaseHelper.get()); - EXPECT_EQ(128u, gtSystemInfo.MaxFillRate); - EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalDsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalGsThreads); - EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); + EXPECT_EQ(0u, gtSystemInfo.MaxFillRate); + EXPECT_EQ(0u, gtSystemInfo.TotalVsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalHsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalDsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalGsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalPsThreadsWindowerRange); + EXPECT_EQ(0u, gtSystemInfo.CsrSizeInMb); EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); + EXPECT_TRUE(gtSystemInfo.IsDynamicallyPopulated); } PVCTEST_F(PvcConfigHwInfoTests, givenPvcConfigWhenSetupMultiTileInfoBaseThenGtSystemInfoIsCorrect) { diff --git a/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp b/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp index dd2f1b8ed4..821fff865a 100644 --- a/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp +++ b/shared/test/unit_test/xe_hpg_core/arl/linux/product_helper_tests_arl.cpp @@ -82,7 +82,6 @@ ARLTEST_F(ArlHwInfoLinux, whenSetupHardwareInfoThenGtSetupIsCorrect) { EXPECT_GT(gtSystemInfo.SubSliceCount, 0u); EXPECT_GT(gtSystemInfo.DualSubSliceCount, 0u); EXPECT_GT_VAL(gtSystemInfo.L3CacheSizeInKb, 0u); - EXPECT_EQ(gtSystemInfo.CsrSizeInMb, 8u); EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); EXPECT_GT(gtSystemInfo.MaxDualSubSlicesSupported, 0u); EXPECT_GT(gtSystemInfo.MaxSlicesSupported, 0u); 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 4e8bbbf440..f16d8bbea0 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 @@ -152,28 +152,19 @@ DG2TEST_F(ProductHelperTestDg2, whenGettingAubstreamProductFamilyThenProperEnumV EXPECT_EQ(aub_stream::ProductFamily::Dg2, productHelper->getAubStreamProductFamily()); } -DG2TEST_F(ProductHelperTestDg2, givenDg2ConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { - HardwareInfo hwInfo = *defaultHwInfo; - GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - Dg2HwConfig::setupHardwareInfoBase(&hwInfo, false, releaseHelper); - - EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalDsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalGsThreads); - EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); - EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); -} - DG2TEST_F(ProductHelperTestDg2, givenDg2ConfigWhenSetupHardwareInfoThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; - Dg2HwConfig::setupHardwareInfo(&hwInfo, false, releaseHelper); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); + + EXPECT_EQ(0u, gtSystemInfo.TotalVsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalHsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalDsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalGsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalPsThreadsWindowerRange); + EXPECT_EQ(0u, gtSystemInfo.CsrSizeInMb); EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); + EXPECT_TRUE(gtSystemInfo.IsDynamicallyPopulated); } DG2TEST_F(ProductHelperTestDg2, givenDg2ProductHelperWhenIsInitBuiltinAsyncSupportedThenReturnTrue) { diff --git a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp index 03d06a6f7c..5d27d3207b 100644 --- a/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp +++ b/shared/test/unit_test/xe_hpg_core/os_agnostic_product_helper_xe_lpg_tests.cpp @@ -44,14 +44,14 @@ HWTEST2_F(XeLpgHwInfoTests, whenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect, GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; hardwareInfoSetup[hwInfo.platform.eProductFamily](&hwInfo, compilerProductHelper->getHwInfoConfig(hwInfo), false, releaseHelper.get()); - EXPECT_EQ(336u, gtSystemInfo.TotalVsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalHsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalDsThreads); - EXPECT_EQ(336u, gtSystemInfo.TotalGsThreads); - EXPECT_EQ(64u, gtSystemInfo.TotalPsThreadsWindowerRange); - EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb); + EXPECT_EQ(0u, gtSystemInfo.TotalVsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalHsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalDsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalGsThreads); + EXPECT_EQ(0u, gtSystemInfo.TotalPsThreadsWindowerRange); + EXPECT_EQ(0u, gtSystemInfo.CsrSizeInMb); EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled); - EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated); + EXPECT_TRUE(gtSystemInfo.IsDynamicallyPopulated); } HWTEST2_F(XeLpgHwInfoTests, whenCheckDirectSubmissionEnginesThenProperValuesAreSetToTrue, IsXeLpg) { @@ -173,11 +173,6 @@ HWTEST2_F(XeLpgHwInfoTests, GivenEmptyHwInfoForUnitTestsWhenSetupHardwareInfoIsC EXPECT_GT_VAL(gtSystemInfo.CCSInfo.NumberOfCCSEnabled, 0u); EXPECT_NE_VAL(hwInfoToSet.featureTable.ftrBcsInfo, 0u); - EXPECT_TRUE(gtSystemInfo.IsDynamicallyPopulated); - - for (uint32_t i = 0; i < gtSystemInfo.SliceCount; i++) { - EXPECT_TRUE(gtSystemInfo.SliceInfo[i].Enabled); - } } HWTEST2_F(XeLpgProductHelperTests, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned, IsXeLpg) { diff --git a/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake b/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake index 345991ebb2..35d0dd8ee4 100644 --- a/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake +++ b/target_unit_tests/xe_hpc_core/pvc/enable_pvc_testing.cmake @@ -1,10 +1,10 @@ # -# Copyright (C) 2021-2023 Intel Corporation +# Copyright (C) 2021-2024 Intel Corporation # # SPDX-License-Identifier: MIT # if(TESTS_PVC) - set(unit_test_config "pvc/2/4/5/47") # non-zero values for unit tests + set(unit_test_config "pvc/2/4/8/47") # non-zero values for unit tests include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake) endif() diff --git a/target_unit_tests/xe_hpg_core/arl/enable_arl_testing.cmake b/target_unit_tests/xe_hpg_core/arl/enable_arl_testing.cmake index e2dbf6070f..8fba0134e5 100644 --- a/target_unit_tests/xe_hpg_core/arl/enable_arl_testing.cmake +++ b/target_unit_tests/xe_hpg_core/arl/enable_arl_testing.cmake @@ -5,6 +5,6 @@ # if(TESTS_ARL) - set(unit_test_config "arl/2/4/5/0/0x7D41") # non-zero values for unit tests + set(unit_test_config "arl/2/4/8/0/0x7D41") # non-zero values for unit tests include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake) endif() diff --git a/target_unit_tests/xe_hpg_core/mtl/enable_mtl_testing.cmake b/target_unit_tests/xe_hpg_core/mtl/enable_mtl_testing.cmake index 3812b3a95a..3fa8eaf2f2 100644 --- a/target_unit_tests/xe_hpg_core/mtl/enable_mtl_testing.cmake +++ b/target_unit_tests/xe_hpg_core/mtl/enable_mtl_testing.cmake @@ -5,6 +5,6 @@ # if(TESTS_MTL) - set(unit_test_config "mtl/2/4/5/0/0x7D40") # non-zero values for unit tests + set(unit_test_config "mtl/2/4/8/0/0x7D40") # non-zero values for unit tests include(${NEO_SOURCE_DIR}/cmake/run_ult_target.cmake) endif()