fix: incorrect check in parseAffinityMask function

Resolves: GSD-8333
Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
Jaroslaw Warchulski
2024-03-18 17:22:59 +00:00
committed by Compute-Runtime-Automation
parent a2742492ab
commit 7c5640669c
2 changed files with 35 additions and 1 deletions

View File

@@ -207,7 +207,7 @@ void ExecutionEnvironment::parseAffinityMask() {
// tiles as devices
if (exposeSubDevicesAsApiDevices) {
if (rootDeviceIndex > numRootDevices) {
if (rootDeviceIndex >= numRootDevices) {
continue;
}

View File

@@ -489,6 +489,40 @@ TEST(ExecutionEnvironment, givenExecutionEnvironmentWhenSettingFP64EmulationEnab
EXPECT_TRUE(executionEnvironment.isFP64EmulationEnabled());
}
TEST(ExecutionEnvironment, givenCorrectZeAffinityMaskWhenExposeSubDevicesAsApiDevicesIsSetThenMapOfSubDeviceIndicesIsSet) {
DebugManagerStateRestore restore;
debugManager.flags.CreateMultipleSubDevices.set(4);
debugManager.flags.ZE_AFFINITY_MASK.set("3");
debugManager.flags.SetCommandStreamReceiver.set(1);
auto hwInfo = *defaultHwInfo;
MockExecutionEnvironment executionEnvironment(&hwInfo);
executionEnvironment.incRefInternal();
executionEnvironment.setExposeSubDevicesAsDevices(true);
DeviceFactory::createDevices(executionEnvironment);
EXPECT_FALSE(executionEnvironment.mapOfSubDeviceIndices.empty());
}
TEST(ExecutionEnvironment, givenIncorrectZeAffinityMaskWhenExposeSubDevicesAsApiDevicesIsSetThenMapOfSubDeviceIndicesIsEmpty) {
DebugManagerStateRestore restore;
debugManager.flags.CreateMultipleSubDevices.set(4);
debugManager.flags.ZE_AFFINITY_MASK.set("4");
debugManager.flags.SetCommandStreamReceiver.set(1);
auto hwInfo = *defaultHwInfo;
MockExecutionEnvironment executionEnvironment(&hwInfo);
executionEnvironment.incRefInternal();
executionEnvironment.setExposeSubDevicesAsDevices(true);
DeviceFactory::createDevices(executionEnvironment);
EXPECT_TRUE(executionEnvironment.mapOfSubDeviceIndices.empty());
}
TEST(ExecutionEnvironmentWithAILTests, whenAILConfigurationIsNullptrAndEnableAILFlagIsTrueWhenInitializingAILThenReturnFalse) {
DebugManagerStateRestore restore;
debugManager.flags.EnableAIL.set(true);