Extended ForceBCSForInternalCopyEngine to apply to L0 internal cmd list

Related-To: NEO-7252

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir 2023-03-29 07:42:16 +00:00 committed by Compute-Runtime-Automation
parent a761003f4b
commit 02a2a5e641
2 changed files with 40 additions and 1 deletions

View File

@ -661,8 +661,15 @@ EngineControl *Device::getInternalCopyEngine() {
if (!getHardwareInfo().capabilityTable.blitterOperationsSupported) {
return nullptr;
}
auto expectedEngine = aub_stream::ENGINE_BCS;
if (DebugManager.flags.ForceBCSForInternalCopyEngine.get() != -1) {
expectedEngine = EngineHelpers::mapBcsIndexToEngineType(DebugManager.flags.ForceBCSForInternalCopyEngine.get(), true);
}
for (auto &engine : allEngines) {
if (engine.osContext->getEngineType() == aub_stream::ENGINE_BCS &&
if (engine.osContext->getEngineType() == expectedEngine &&
engine.osContext->isInternalEngine()) {
return &engine;
}

View File

@ -38,6 +38,38 @@ TEST(DeviceBlitterTest, whenBlitterOperationsSupportIsDisabledThenNoInternalCopy
EXPECT_EQ(nullptr, factory.rootDevices[0]->getInternalCopyEngine());
}
TEST(DeviceBlitterTest, givenForceBCSForInternalCopyEngineToIndexZeroWhenGetInternalCopyEngineIsCalledThenInternalMainCopyEngineIsReturned) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceBCSForInternalCopyEngine.set(0);
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
UltDeviceFactory factory{1, 0};
factory.rootDevices[0]->createEngine(0, {aub_stream::EngineType::ENGINE_BCS, EngineUsage::Internal});
auto engine = factory.rootDevices[0]->getInternalCopyEngine();
EXPECT_NE(nullptr, engine);
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS, engine->getEngineType());
EXPECT_EQ(EngineUsage::Internal, engine->getEngineUsage());
}
TEST(DeviceBlitterTest, givenForceBCSForInternalCopyEngineToIndexOneWhenGetInternalLinkCopyEngineIsCalledThenInternalLinkCopyEngineOneIsReturned) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.ForceBCSForInternalCopyEngine.set(1);
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
UltDeviceFactory factory{1, 0};
factory.rootDevices[0]->createEngine(0, {aub_stream::EngineType::ENGINE_BCS1, EngineUsage::Internal});
auto engine = factory.rootDevices[0]->getInternalCopyEngine();
EXPECT_NE(nullptr, engine);
EXPECT_EQ(aub_stream::EngineType::ENGINE_BCS1, engine->getEngineType());
EXPECT_EQ(EngineUsage::Internal, engine->getEngineUsage());
}
TEST(DeviceBlitterTest, givenBlitterOperationsDisabledWhenCreatingBlitterEngineThenAbort) {
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
defaultHwInfo->capabilityTable.blitterOperationsSupported = false;