mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
fix: incorrect check in parseAffinityMask function
Resolves: GSD-8333 Signed-off-by: Jaroslaw Warchulski <jaroslaw.warchulski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a2742492ab
commit
7c5640669c
@@ -207,7 +207,7 @@ void ExecutionEnvironment::parseAffinityMask() {
|
||||
|
||||
// tiles as devices
|
||||
if (exposeSubDevicesAsApiDevices) {
|
||||
if (rootDeviceIndex > numRootDevices) {
|
||||
if (rootDeviceIndex >= numRootDevices) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user