fix: expose single device mode

- return internal engine as default engine when defaultEngineIndex is not
yet set
- return correct internal engine from Device::getInternalEngine()

Resolves: HSD-18043691881

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2025-10-28 18:45:22 +00:00
committed by Compute-Runtime-Automation
parent c5384f7c01
commit 08fc0c1e1f
5 changed files with 76 additions and 1 deletions

View File

@@ -1291,6 +1291,15 @@ OsContext *MemoryManager::getDefaultEngineContext(uint32_t rootDeviceIndex, Devi
break;
}
}
if (!defaultContext && peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->isExposeSingleDeviceMode()) {
for (auto &engine : getRegisteredEngines(rootDeviceIndex)) {
auto osContext = engine.osContext;
if (osContext->isInternalEngine() && osContext->getDeviceBitfield() == subdevicesBitfield) {
defaultContext = osContext;
break;
}
}
}
if (!defaultContext) {
defaultContext = getRegisteredEngines(rootDeviceIndex)[defaultEngineIndex[rootDeviceIndex]].osContext;
}