SWDEV-486602 - Add tracking of HSA handlers

Add an atomic counter to track the outstanding HSA handlers.
Wait on CPU for the callbacks if the number exceeds the value
in DEBUG_HIP_BLOCK_SYNC env variable.

Change-Id: I95dc8c4bf0258c7e59411b7504220709ed6898c5
Этот коммит содержится в:
German Andryeyev
2024-10-23 16:15:46 -04:00
родитель 556390f9c7
Коммит 403f624bf8
4 изменённых файлов: 17 добавлений и 9 удалений
+5
Просмотреть файл
@@ -141,6 +141,11 @@ void HostQueue::finish(bool cpu_wait) {
"Can't claim the queue is finished with the active batch!");
return;
}
// Force blocking wait if requested. That allows to avoid a build up of unreleased CPU commands
if ((DEBUG_HIP_BLOCK_SYNC > 0) &&
(vdev()->QueuedAsyncHandlers().load() > DEBUG_HIP_BLOCK_SYNC)) {
cpu_wait = true;
}
}
// Force marker if the batch wasn't sent for CPU update or fence is dirty
if (nullptr == command || (GetSubmissionBatch() != nullptr) || vdev()->isFenceDirty()) {