performance: do not free deferred allocations when not needed

Level Zero doesn't use deferred allocations so no point in paying the
price to check for them in cleanAllocationList.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2023-10-27 16:43:33 +00:00
committed by Compute-Runtime-Automation
parent 39cf653959
commit 80e3632c41
5 changed files with 9 additions and 6 deletions

View File

@@ -121,6 +121,7 @@ CommandStreamReceiver::~CommandStreamReceiver() {
internalAllocationStorage->cleanAllocationList(-1, REUSABLE_ALLOCATION);
internalAllocationStorage->cleanAllocationList(-1, TEMPORARY_ALLOCATION);
internalAllocationStorage->cleanAllocationList(-1, DEFERRED_DEALLOCATION);
getMemoryManager()->unregisterEngineForCsr(this);
}
@@ -221,6 +222,9 @@ WaitStatus CommandStreamReceiver::waitForTaskCountAndCleanAllocationList(TaskCou
waitStatus = this->CommandStreamReceiver::waitForTaskCount(requiredTaskCount);
}
internalAllocationStorage->cleanAllocationList(requiredTaskCount, allocationUsage);
if (allocationUsage == TEMPORARY_ALLOCATION) {
internalAllocationStorage->cleanAllocationList(requiredTaskCount, DEFERRED_DEALLOCATION);
}
return waitStatus;
}