fix: ReturnSubDevicesAsApiDevices flag being ignored

Proper subdevice count being returned now in GfxCoreHelper
path, as previous method ignored the usage of the
ReturnSubDevicesAsApiDevices flag.

Related-To: LOCI-4859

Signed-off-by: Latif, Raiyan <raiyan.latif@intel.com>
This commit is contained in:
Latif, Raiyan
2023-10-09 17:01:40 +00:00
committed by Compute-Runtime-Automation
parent c7287f9feb
commit dee5ecfdf3
2 changed files with 22 additions and 0 deletions

View File

@@ -72,6 +72,8 @@ uint32_t GfxCoreHelper::getMaxThreadsForVfe(const HardwareInfo &hwInfo) {
uint32_t GfxCoreHelper::getSubDevicesCount(const HardwareInfo *pHwInfo) {
if (DebugManager.flags.CreateMultipleSubDevices.get() > 0) {
return DebugManager.flags.CreateMultipleSubDevices.get();
} else if (DebugManager.flags.ReturnSubDevicesAsApiDevices.get() > 0) {
return 1u;
} else if (pHwInfo->gtSystemInfo.MultiTileArchInfo.IsValid && pHwInfo->gtSystemInfo.MultiTileArchInfo.TileCount > 0u) {
return pHwInfo->gtSystemInfo.MultiTileArchInfo.TileCount;
} else {

View File

@@ -51,6 +51,26 @@ TEST(AubHelper, GivenMultipleSubDevicesWhenGettingDeviceCountThenCorrectValueIsR
EXPECT_EQ(devicesCount, 1u);
}
TEST(AubHelper, GivenReturnSubDevicesAsApiDevicesWhenGettingDeviceCountThenCorrectValueIsReturned) {
DebugManagerStateRestore stateRestore;
FeatureTable featureTable = {};
WorkaroundTable workaroundTable = {};
RuntimeCapabilityTable capTable = {};
GT_SYSTEM_INFO sysInfo = {};
PLATFORM platform = {};
sysInfo.MultiTileArchInfo.IsValid = true;
sysInfo.MultiTileArchInfo.TileCount = 2;
HardwareInfo hwInfo{&platform, &featureTable, &workaroundTable, &sysInfo, capTable};
uint32_t devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo);
EXPECT_EQ(devicesCount, 2u);
DebugManager.flags.ReturnSubDevicesAsApiDevices.set(1);
devicesCount = GfxCoreHelper::getSubDevicesCount(&hwInfo);
EXPECT_EQ(devicesCount, 1u);
}
TEST(AubHelper, WhenGetMemTraceIsCalledWithLocalMemoryPDEntryBitsThenTraceLocalIsReturned) {
int hint = AubHelper::getMemTrace(BIT(PageTableEntry::localMemoryBit));
EXPECT_EQ(AubMemDump::AddressSpaceValues::TraceLocal, hint);