feature: enable in-order counter waits if temp allocation storage is empty

Related-To: NEO-7966

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-10-31 18:33:09 +00:00
committed by Compute-Runtime-Automation
parent afd693387b
commit c9376c9829
2 changed files with 57 additions and 2 deletions

View File

@@ -893,7 +893,11 @@ template <GFXCORE_FAMILY gfxCoreFamily>
ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::hostSynchronize(uint64_t timeout, TaskCountType taskCount, bool handlePostWaitOperations) {
ze_result_t status = ZE_RESULT_SUCCESS;
bool inOrderWaitAllowed = (isInOrderExecutionEnabled() && !handlePostWaitOperations && this->latestFlushIsHostVisible);
auto internalAllocStorage = this->csr->getInternalAllocationStorage();
auto tempAllocsCleanupRequired = handlePostWaitOperations && !internalAllocStorage->getTemporaryAllocations().peekIsEmpty();
bool inOrderWaitAllowed = (isInOrderExecutionEnabled() && !tempAllocsCleanupRequired && this->latestFlushIsHostVisible);
if (inOrderWaitAllowed) {
status = synchronizeInOrderExecution(timeout);
@@ -912,7 +916,10 @@ ze_result_t CommandListCoreFamilyImmediate<gfxCoreFamily>::hostSynchronize(uint6
if (handlePostWaitOperations && status != ZE_RESULT_NOT_READY) {
if (status == ZE_RESULT_SUCCESS) {
this->cmdQImmediate->unregisterCsrClient();
this->csr->getInternalAllocationStorage()->cleanAllocationList(taskCount, NEO::AllocationUsage::TEMPORARY_ALLOCATION);
if (tempAllocsCleanupRequired) {
internalAllocStorage->cleanAllocationList(taskCount, NEO::AllocationUsage::TEMPORARY_ALLOCATION);
}
}
this->printKernelsPrintfOutput(status == ZE_RESULT_ERROR_DEVICE_LOST);