fix: correct reporting num subslices per slice in device properties

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-01-20 19:22:19 +00:00
committed by Compute-Runtime-Automation
parent ad3110ff67
commit 468b61b844
2 changed files with 12 additions and 1 deletions

View File

@ -981,7 +981,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
if (NEO::debugManager.flags.DebugApiUsed.get() == 1) {
pDeviceProperties->numSubslicesPerSlice = hardwareInfo.gtSystemInfo.MaxSubSlicesSupported / hardwareInfo.gtSystemInfo.MaxSlicesSupported;
} else {
pDeviceProperties->numSubslicesPerSlice = hardwareInfo.gtSystemInfo.SubSliceCount / hardwareInfo.gtSystemInfo.SliceCount;
pDeviceProperties->numSubslicesPerSlice = NEO::getNumSubSlicesPerSlice(hardwareInfo);
}
pDeviceProperties->numSlices = hardwareInfo.gtSystemInfo.SliceCount;

View File

@ -1274,6 +1274,13 @@ TEST_F(MultiSubDeviceCachePropertiesTest, givenDeviceWithSubDevicesWhenQueriedFo
}
TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenAllPropertiesAreAssigned) {
auto &hwInfo = *neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo.gtSystemInfo.SliceCount = 3;
hwInfo.gtSystemInfo.SubSliceCount = 5;
hwInfo.gtSystemInfo.MaxEuPerSubSlice = 8;
ze_device_properties_t deviceProperties, devicePropertiesBefore;
deviceProperties = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
@ -1317,6 +1324,10 @@ TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDevicePropertiesCalledThenA
EXPECT_NE(deviceProperties.kernelTimestampValidBits, devicePropertiesBefore.kernelTimestampValidBits);
EXPECT_NE(0, memcmp(&deviceProperties.name, &devicePropertiesBefore.name, sizeof(devicePropertiesBefore.name)));
EXPECT_NE(deviceProperties.maxMemAllocSize, devicePropertiesBefore.maxMemAllocSize);
EXPECT_EQ(8u, deviceProperties.numEUsPerSubslice);
EXPECT_EQ(2u, deviceProperties.numSubslicesPerSlice);
EXPECT_EQ(3u, deviceProperties.numSlices);
}
TEST_F(DeviceTest, givenDevicePropertiesStructureWhenDriverInfoIsEmptyThenDeviceNameTheSameAsInDeviceInfo) {