fix: store registered engines per root device

in most cases we need to iterate over engines associated to single root device

Related-To: NEO-7925
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-04-26 10:36:25 +00:00
committed by Compute-Runtime-Automation
parent 9cc5763800
commit 32d8a3bc6d
62 changed files with 777 additions and 805 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -19,7 +19,7 @@ DeferrableAllocationDeletion::DeferrableAllocationDeletion(MemoryManager &memory
bool DeferrableAllocationDeletion::apply() {
if (graphicsAllocation.isUsed()) {
bool isStillUsed = false;
for (auto &engine : memoryManager.getRegisteredEngines()) {
for (auto &engine : memoryManager.getRegisteredEngines(graphicsAllocation.getRootDeviceIndex())) {
auto contextId = engine.osContext->getContextId();
if (graphicsAllocation.isUsedByOsContext(contextId)) {
if (engine.commandStreamReceiver->testTaskCountReady(engine.commandStreamReceiver->getTagAddress(), graphicsAllocation.getTaskCount(contextId))) {