Improve affinity mask handling

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-09-02 16:06:00 +00:00
committed by Compute-Runtime-Automation
parent 984f697ae2
commit 3216302499
2 changed files with 19 additions and 10 deletions

View File

@@ -755,7 +755,7 @@ TEST_F(EngineInstancedDeviceTests, givenAffinityMaskForSingle2rdLevelDeviceOnlyW
constexpr uint32_t genericDeviceIndex = 0;
constexpr uint32_t engineInstancedEngineIndex = 1;
DebugManager.flags.ZE_AFFINITY_MASK.set("0.1, 0.9");
DebugManager.flags.ZE_AFFINITY_MASK.set("0.0.1, 0.9");
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
@@ -778,6 +778,23 @@ TEST_F(EngineInstancedDeviceTests, givenAffinityMaskForSingle2rdLevelDeviceOnlyW
EXPECT_TRUE(hasEngineInstancedEngines(rootDevice, engineType));
}
TEST_F(EngineInstancedDeviceTests, givenAffinityMaskForSecondLevelOnSingleTileDeviceWhenCreatingThenEnableAllEngineInstancedDevices) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 2;
DebugManager.flags.ZE_AFFINITY_MASK.set("0.0");
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
EXPECT_FALSE(hasRootCsrOnly(rootDevice));
EXPECT_FALSE(rootDevice->isEngineInstanced());
EXPECT_EQ(0u, rootDevice->getNumGenericSubDevices());
EXPECT_EQ(ccsCount, rootDevice->getNumSubDevices());
}
HWTEST2_F(EngineInstancedDeviceTests, givenEngineInstancedDeviceWhenProgrammingCfeStateThenSetSingleSliceDispatch, IsAtLeastXeHpCore) {
using CFE_STATE = typename FamilyType::CFE_STATE;

View File

@@ -136,15 +136,7 @@ void ExecutionEnvironment::parseAffinityMask() {
if (subEntries.size() > 1) {
uint32_t subDeviceIndex = StringHelpers::toUint32t(subEntries[1]);
bool enableSecondLevelEngineInstanced = ((subDevicesCount == 1) && (hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled > 1));
if (enableSecondLevelEngineInstanced) {
UNRECOVERABLE_IF(subEntries.size() != 2);
if (subDeviceIndex < hwInfo->gtSystemInfo.CCSInfo.NumberOfCCSEnabled) {
affinityMaskHelper[rootDeviceIndex].enableEngineInstancedSubDevice(0, subDeviceIndex); // Mask: X.Y
}
} else if (subDeviceIndex < subDevicesCount) {
if (subDeviceIndex < subDevicesCount) {
if (subEntries.size() == 2) {
affinityMaskHelper[rootDeviceIndex].enableGenericSubDevice(subDeviceIndex); // Mask: X.Y
} else {