fix: correct subslice space calculation for dg2

respect max subslice count

Related-To: NEO-12086
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2024-07-23 12:44:39 +00:00
committed by Compute-Runtime-Automation
parent 635f596599
commit 59c9930efb
3 changed files with 24 additions and 2 deletions

View File

@@ -169,7 +169,7 @@ uint32_t ProductHelperHw<gfxProduct>::computeMaxNeededSubSliceSpace(const Hardwa
UNRECOVERABLE_IF(highestEnabledSlice == 0);
UNRECOVERABLE_IF(hwInfo.gtSystemInfo.MaxSlicesSupported == 0);
auto subSlicesPerSlice = hwInfo.gtSystemInfo.MaxSubSlicesSupported / hwInfo.gtSystemInfo.MaxSlicesSupported;
auto maxSubSlice = highestEnabledSlice * subSlicesPerSlice;
auto maxSubSlice = std::max(highestEnabledSlice * subSlicesPerSlice, hwInfo.gtSystemInfo.MaxSubSlicesSupported);
return maxSubSlice;
}

View File

@@ -991,3 +991,23 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenItsPreXe2ThenCacheLineSizeIs6
HWTEST2_F(ProductHelperTest, givenProductHelperWhenItsXe2PlusThenCacheLineSizeIs256Bytes, IsAtLeastBmg) {
EXPECT_EQ(productHelper->getCacheLineSize(), 256u);
}
TEST_F(ProductHelperTest, whenGettingMaxSubSliceSpaceThenValueIsNotSmallerThanMaxSubSliceCount) {
constexpr auto maxSupportedSubSlices = 128u;
auto hwInfo = *defaultHwInfo;
auto &gtSystemInfo = hwInfo.gtSystemInfo;
gtSystemInfo.SliceCount = 1;
gtSystemInfo.SubSliceCount = 2;
gtSystemInfo.DualSubSliceCount = 2;
gtSystemInfo.MaxSlicesSupported = 2;
gtSystemInfo.MaxSlicesSupported = 2;
gtSystemInfo.MaxSubSlicesSupported = maxSupportedSubSlices;
gtSystemInfo.MaxDualSubSlicesSupported = maxSupportedSubSlices;
gtSystemInfo.IsDynamicallyPopulated = true;
for (uint32_t slice = 0; slice < GT_MAX_SLICE; slice++) {
gtSystemInfo.SliceInfo[slice].Enabled = slice < gtSystemInfo.SliceCount;
}
EXPECT_EQ(maxSupportedSubSlices, productHelper->computeMaxNeededSubSliceSpace(hwInfo));
}

View File

@@ -676,6 +676,8 @@ DG2TEST_F(ProductHelperTestDg2, givenDg2WhenSetForceNonCoherentThenProperFlagSet
DG2TEST_F(ProductHelperTestDg2, givenEnabledSliceInNonStandardConfigWhenComputeUnitsUsedForScratchThenProperCalculationIsReturned) {
HardwareInfo &hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
GT_SYSTEM_INFO &testSysInfo = hwInfo.gtSystemInfo;
testSysInfo.MaxSlicesSupported = 2;
testSysInfo.SliceCount = 2;
testSysInfo.IsDynamicallyPopulated = true;
for (auto &sliceInfo : testSysInfo.SliceInfo) {
sliceInfo.Enabled = false;