fix: correct scope for usm allocations indirect access lock

Related-To: NEO-10356

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2025-04-10 20:55:03 +00:00
committed by Compute-Runtime-Automation
parent 9e14eaaed1
commit 09c9b555f9
2 changed files with 7 additions and 4 deletions

View File

@@ -491,6 +491,7 @@ inline ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::executeCommand
static_cast<CommandQueueHw<gfxCoreFamily> *>(this->cmdQImmediate)->patchCommands(*this, 0u, false);
} else {
lockForIndirect = std::move(*outerLockForIndirect);
cmdQImp->makeResidentForResidencyContainer(this->commandContainer.getResidencyContainer());
}
@@ -1773,6 +1774,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendCommandLists(ui
auto queueImp = static_cast<CommandQueueImp *>(this->cmdQImmediate);
auto mainAppendLock = queueImp->getCsr()->obtainUniqueOwnership();
std::unique_lock<std::mutex> mainLockForIndirect;
if (this->dispatchCmdListBatchBufferAsPrimary) {
// check if wait event preamble or implicit synchronization is present and force bb start jump in queue, even when no preamble is required there
@@ -1784,7 +1786,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendCommandLists(ui
nullptr,
true,
this->commandContainer.getCommandStream(),
nullptr);
&mainLockForIndirect);
if (ret != ZE_RESULT_SUCCESS) {
return ret;
}
@@ -1817,7 +1819,7 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::appendCommandLists(ui
hSignalEvent,
requireTaskCountUpdate,
&mainAppendLock,
nullptr);
&mainLockForIndirect);
}
} // namespace L0

View File

@@ -112,7 +112,7 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandLists(
csr->isProgramActivePartitionConfigRequired(),
performMigration,
csr->getSipSentFlag()};
ctx.outerLockForIndirect = outerLockForIndirect;
ctx.globalInit |= ctx.isDebugEnabled &&
!this->commandQueueDebugCmdsProgrammed &&
device->getL0Debugger();
@@ -300,7 +300,8 @@ ze_result_t CommandQueueHw<gfxCoreFamily>::executeCommandListsRegular(
std::unique_lock<std::mutex> lockForIndirect;
if (ctx.hasIndirectAccess) {
handleIndirectAllocationResidency(ctx.unifiedMemoryControls, lockForIndirect, ctx.isMigrationRequested);
std::unique_lock<std::mutex> &currentLock = ctx.outerLockForIndirect != nullptr ? *ctx.outerLockForIndirect : lockForIndirect;
handleIndirectAllocationResidency(ctx.unifiedMemoryControls, currentLock, ctx.isMigrationRequested);
}
size_t linearStreamSizeEstimate = this->estimateLinearStreamSizeInitial(ctx);