Base hwInfo values setup for AOT

In most cases, there was code redundancy, which was minimized in this change.
The setupHardwareInfoBase extraction will also be used for ocloc.

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
Related-To: NEO-6910
This commit is contained in:
Daria Hinz
2022-05-10 12:52:14 +00:00
committed by Compute-Runtime-Automation
parent ee4a177296
commit de74becdb8
46 changed files with 527 additions and 525 deletions

View File

@@ -6,6 +6,7 @@
*/
#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"
#include "shared/test/common/test_macros/test.h"
@@ -52,3 +53,35 @@ PVCTEST_F(PvcConfigHwInfoTests, givenPvcDeviceIdsAndRevisionsWhenCheckingConfigs
EXPECT_FALSE(PVC::isAtMostXtA0(hwInfo));
}
}
PVCTEST_F(PvcConfigHwInfoTests, givenPvcConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
PVC::setupHardwareInfoBase(&hwInfo, false);
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_FALSE(gtSystemInfo.IsL3HashModeEnabled);
EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated);
}
PVCTEST_F(PvcConfigHwInfoTests, givenPvcConfigWhenSetupMultiTileInfoBaseThenGtSystemInfoIsCorrect) {
DebugManagerStateRestore restorer;
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
PVC::setupHardwareInfoMultiTileBase(&hwInfo, false);
EXPECT_FALSE(gtSystemInfo.MultiTileArchInfo.IsValid);
EXPECT_EQ(1u, gtSystemInfo.MultiTileArchInfo.TileCount);
EXPECT_EQ(static_cast<uint8_t>(maxNBitValue(1u)), gtSystemInfo.MultiTileArchInfo.TileMask);
DebugManager.flags.CreateMultipleSubDevices.set(2);
PVC::setupHardwareInfoMultiTileBase(&hwInfo, true);
EXPECT_TRUE(gtSystemInfo.MultiTileArchInfo.IsValid);
EXPECT_EQ(2u, gtSystemInfo.MultiTileArchInfo.TileCount);
EXPECT_EQ(static_cast<uint8_t>(maxNBitValue(2u)), gtSystemInfo.MultiTileArchInfo.TileMask);
}

View File

@@ -26,11 +26,26 @@ DG2TEST_F(HwInfoConfigTestDg2, whenConvertingTimestampsToCsDomainThenGpuTicksAre
EXPECT_EQ(expectedGpuTicks, gpuTicks);
}
DG2TEST_F(HwInfoConfigTestDg2, givenDg2ConfigWhenSetupHardwareInfoMultiTileThenGtSystemInfoIsSetCorrect) {
DG2TEST_F(HwInfoConfigTestDg2, givenDg2ConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
DG2_CONFIG::setupHardwareInfoBase(&hwInfo, false);
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(HwInfoConfigTestDg2, givenDg2ConfigWhenSetupHardwareInfoThenGtSystemInfoIsCorrect) {
HardwareInfo hwInfo = *defaultHwInfo;
GT_SYSTEM_INFO &gtSystemInfo = hwInfo.gtSystemInfo;
DG2_CONFIG::setupHardwareInfoMultiTile(&hwInfo, false, false);
DG2_CONFIG::setupHardwareInfo(&hwInfo, false);
EXPECT_EQ(8u, gtSystemInfo.CsrSizeInMb);
EXPECT_FALSE(gtSystemInfo.IsL3HashModeEnabled);
EXPECT_FALSE(gtSystemInfo.IsDynamicallyPopulated);