Set correct MaxSlicesSupported in gtSystemInfo

- calculate maxSubsliceCount in translateTopologyInfo
based on enabled bits

Related-To: LOCI-2080

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-05-17 15:04:01 +00:00
committed by Compute-Runtime-Automation
parent 35acadaf78
commit 4407bf9c49
4 changed files with 39 additions and 4 deletions

View File

@ -668,3 +668,26 @@ TEST(DrmQueryTest, GivenDrmWhenSetupHardwareInfoCalledThenCorrectMaxValuesInGtSy
EXPECT_EQ(NEO::defaultHwInfo->gtSystemInfo.MaxSubSlicesSupported, hwInfo->gtSystemInfo.MaxSubSlicesSupported);
EXPECT_EQ(NEO::defaultHwInfo->gtSystemInfo.MaxEuPerSubSlice, hwInfo->gtSystemInfo.MaxEuPerSubSlice);
}
TEST(DrmQueryTest, GivenLessAvailableSubSlicesThanMaxSubSlicesWhenQueryingTopologyInfoThenCorrectMaxSubSliceCountIsSet) {
auto executionEnvironment = std::make_unique<ExecutionEnvironment>();
executionEnvironment->prepareRootDeviceEnvironments(1);
*executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo() = *NEO::defaultHwInfo.get();
DrmMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
drm.disableSomeTopology = true;
Drm::QueryTopologyData topologyData = {};
drm.StoredSVal = 2;
drm.StoredSSVal = 6;
drm.StoredEUVal = 16;
EXPECT_TRUE(drm.queryTopology(*executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo(), topologyData));
EXPECT_EQ(1, topologyData.sliceCount);
EXPECT_EQ(1, topologyData.subSliceCount);
EXPECT_EQ(1, topologyData.euCount);
EXPECT_EQ(drm.StoredSVal, topologyData.maxSliceCount);
EXPECT_EQ(2, topologyData.maxSubSliceCount);
}