fix: check for new bcs submission before releasing queue resources

Related-To: NEO-9005

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-09-28 12:24:42 +00:00
committed by Compute-Runtime-Automation
parent a033df33ff
commit e2387a450b
2 changed files with 75 additions and 2 deletions

View File

@@ -1291,9 +1291,25 @@ WaitStatus CommandQueue::waitForAllEngines(bool blockedQueue, PrintfHandler *pri
waitStatus = waitUntilComplete(taskCountToWait, activeBcsStates, flushStamp->peekStamp(), false, cleanTemporaryAllocationsList, waitedOnTimestamps);
TakeOwnershipWrapper<CommandQueue> queueOwnership(*this);
{
TakeOwnershipWrapper<CommandQueue> queueOwnership(*this);
handlePostCompletionOperations(this->taskCount != taskCountToWait);
/*
Check if queue resources cleanup after wait is possible.
If new submission happened during wait, we need to query completion (without waiting).
*/
bool checkCompletion = (this->taskCount != taskCountToWait);
for (auto &state : activeBcsStates) {
if (this->bcsStates[EngineHelpers::getBcsIndex(state.engineType)].taskCount != state.taskCount) {
checkCompletion = true;
break;
}
}
handlePostCompletionOperations(checkCompletion);
}
if (printfHandler) {
if (!printfHandler->printEnqueueOutput()) {