fix: report correct EU counts for multi-slice platforms

Related-To: GSD-10625
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
Jaroslaw Warchulski 2025-01-17 13:37:14 +00:00 committed by Compute-Runtime-Automation
parent 01e59c1b78
commit c3c2028ed6
2 changed files with 12 additions and 21 deletions

View File

@ -1042,7 +1042,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
}
} else if (extendedProperties->stype == ZE_STRUCTURE_TYPE_EU_COUNT_EXT) {
ze_eu_count_ext_t *zeEuCountDesc = reinterpret_cast<ze_eu_count_ext_t *>(extendedProperties);
uint32_t numTotalEUs = hardwareInfo.gtSystemInfo.MaxEuPerSubSlice * hardwareInfo.gtSystemInfo.SubSliceCount * hardwareInfo.gtSystemInfo.SliceCount;
uint32_t numTotalEUs = hardwareInfo.gtSystemInfo.EUCount;
if (isImplicitScalingCapable()) {
numTotalEUs *= neoDevice->getNumGenericSubDevices();

View File

@ -1360,18 +1360,15 @@ TEST_F(DeviceTest, WhenRequestingZeEuCountThenExpectedEUsAreReturned) {
ze_eu_count_ext_t zeEuCountDesc = {ZE_STRUCTURE_TYPE_EU_COUNT_EXT};
deviceProperties.pNext = &zeEuCountDesc;
uint32_t maxEuPerSubSlice = 48;
uint32_t subSliceCount = 8;
uint32_t sliceCount = 1;
uint32_t maxEuPerSubSlice = 8;
uint32_t subSliceCount = 18;
uint32_t expectedEUs = maxEuPerSubSlice * subSliceCount;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.MaxEuPerSubSlice = maxEuPerSubSlice;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.SubSliceCount = subSliceCount;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.SliceCount = sliceCount;
auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->gtSystemInfo.EUCount = expectedEUs;
device->getProperties(&deviceProperties);
uint32_t expectedEUs = maxEuPerSubSlice * subSliceCount * sliceCount;
EXPECT_EQ(expectedEUs, zeEuCountDesc.numTotalEUs);
}
@ -1383,16 +1380,13 @@ TEST_F(DeviceTest, WhenRequestingZeEuCountWithoutStypeCorrectThenNoEusAreReturne
uint32_t maxEuPerSubSlice = 48;
uint32_t subSliceCount = 8;
uint32_t sliceCount = 1;
uint32_t expectedEUs = maxEuPerSubSlice * subSliceCount;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.MaxEuPerSubSlice = maxEuPerSubSlice;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.SubSliceCount = subSliceCount;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.SliceCount = sliceCount;
auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->gtSystemInfo.EUCount = expectedEUs;
device->getProperties(&deviceProperties);
uint32_t expectedEUs = maxEuPerSubSlice * subSliceCount * sliceCount;
EXPECT_NE(expectedEUs, zeEuCountDesc.numTotalEUs);
EXPECT_EQ(std::numeric_limits<uint32_t>::max(), zeEuCountDesc.numTotalEUs);
}
@ -2524,17 +2518,14 @@ TEST_F(MultipleDevicesEnabledImplicitScalingTest, WhenRequestingZeEuCountThenExp
uint32_t maxEuPerSubSlice = 48;
uint32_t subSliceCount = 8;
uint32_t sliceCount = 1;
uint32_t expectedEUs = maxEuPerSubSlice * subSliceCount;
L0::Device *device = driverHandle->devices[0];
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.MaxEuPerSubSlice = maxEuPerSubSlice;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.SubSliceCount = subSliceCount;
device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo()->gtSystemInfo.SliceCount = sliceCount;
auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->gtSystemInfo.EUCount = expectedEUs;
device->getProperties(&deviceProperties);
uint32_t expectedEUs = maxEuPerSubSlice * subSliceCount * sliceCount;
EXPECT_EQ(expectedEUs * numSubDevices, zeEuCountDesc.numTotalEUs);
}