refactor: remove ReturnSubDevicesAsApiDevices from shared code

Related-To: NEO-9437

Signed-off-by: Baj, Tomasz <tomasz.baj@intel.com>
This commit is contained in:
Baj, Tomasz
2023-11-08 12:55:37 +00:00
committed by Compute-Runtime-Automation
parent 12b4a9f71d
commit c49a9b9787
8 changed files with 6 additions and 111 deletions

View File

@@ -687,33 +687,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssAndZeAffinityMaskSe
}
}
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevicesModelThenThenProperNumberDevicesIsExposed) {
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
DebugManagerStateRestore restorer;
uint32_t numRootDevices = 4;
uint32_t numSubDevices = 4;
DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices);
DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
uint32_t expectedRootDevices = 4;
DebugManager.flags.ZE_AFFINITY_MASK.set("0,3,4,1.1,9,15,25");
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ReturnSubDevicesAsApiDevices.set(1);
auto hwInfo = *defaultHwInfo;
MockExecutionEnvironment executionEnvironment(&hwInfo, false, numRootDevices);
executionEnvironment.incRefInternal();
auto devices = DeviceFactory::createDevices(executionEnvironment);
EXPECT_EQ(devices.size(), expectedRootDevices);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevicesModelThenProperSubDeviceHierarchyMapisSet) {
std::unordered_map<std::string, std::string> mockableEnvs = {{"ZE_FLAT_DEVICE_HIERARCHY", "FLAT"}};
VariableBackup<std::unordered_map<std::string, std::string> *> mockableEnvValuesBackup(&IoFunctions::mockableEnvValues, &mockableEnvs);
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
DebugManagerStateRestore restorer;
@@ -728,7 +704,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndTilesAsDevice
DebugManager.flags.ZE_AFFINITY_MASK.set("0,3,4,1.1,9,15,25");
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ReturnSubDevicesAsApiDevices.set(1);
auto hwInfo = *defaultHwInfo;
@@ -766,7 +741,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetThenProperSubDev
DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
uint32_t expectedRootDevices = 4;
DebugManager.flags.ZE_AFFINITY_MASK.set("0.2,1.2,2.3,3.3");
DebugManager.flags.ZE_AFFINITY_MASK.set("0.2,1.2,2.3,3.3,15,25");
DebugManager.flags.SetCommandStreamReceiver.set(1);
@@ -806,7 +781,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetWithoutTilesThen
DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
uint32_t expectedRootDevices = 4;
DebugManager.flags.ZE_AFFINITY_MASK.set("0,1,2,3");
DebugManager.flags.ZE_AFFINITY_MASK.set("0,1,2,3,15,25");
DebugManager.flags.SetCommandStreamReceiver.set(1);
@@ -823,32 +798,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetWithoutTilesThen
}
}
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZeAffinityMaskSetAndRootDevicesAsDevicesModelThenThenProperNumberRootDevicesIsExposed) {
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
DebugManagerStateRestore restorer;
uint32_t numRootDevices = 4;
uint32_t numSubDevices = 4;
DebugManager.flags.CreateMultipleRootDevices.set(numRootDevices);
DebugManager.flags.CreateMultipleSubDevices.set(numSubDevices);
uint32_t expectedRootDevices = 3;
DebugManager.flags.ZE_AFFINITY_MASK.set("0,3,1.1,15,25");
DebugManager.flags.SetCommandStreamReceiver.set(1);
DebugManager.flags.ReturnSubDevicesAsApiDevices.set(0);
auto hwInfo = *defaultHwInfo;
MockExecutionEnvironment executionEnvironment(&hwInfo, false, numRootDevices);
executionEnvironment.incRefInternal();
auto devices = DeviceFactory::createDevices(executionEnvironment);
EXPECT_EQ(devices.size(), expectedRootDevices);
}
HWCMDTEST_F(IGFX_XE_HP_CORE, DeviceTests, givenZexNumberOfCssEnvVariableIsLargerThanNumberOfAvailableCcsCountWhenDeviceIsCreatedThenCreateDevicesWithAvailableCcsCount) {
VariableBackup<UltHwConfig> backup(&ultHwConfig);
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;