[llvm] [Offload][L0] clear completed events from a wait list (PR #186379)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 05:08:21 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: Piotr Balcer (pbalcer)

<details>
<summary>Changes</summary>

Queue's WaitEvent collection wasn't being cleared after synchronization and resetting of the events. This led to hangs on subsequent host synchronizations if not preceeded by any other operation.

---
Full diff: https://github.com/llvm/llvm-project/pull/186379.diff


1 Files Affected:

- (modified) offload/plugins-nextgen/level_zero/src/L0Device.cpp (+3) 


``````````diff
diff --git a/offload/plugins-nextgen/level_zero/src/L0Device.cpp b/offload/plugins-nextgen/level_zero/src/L0Device.cpp
index 4db3c4e47f544..ef521ab681b4f 100644
--- a/offload/plugins-nextgen/level_zero/src/L0Device.cpp
+++ b/offload/plugins-nextgen/level_zero/src/L0Device.cpp
@@ -319,6 +319,9 @@ Error L0DeviceTy::synchronizeImpl(__tgt_async_info &AsyncInfo,
           return Err;
       }
     }
+    // In either case, all the events are now reset and released
+    // back into the pool. We need to clear them from the queue.
+    AsyncQueue->WaitEvents.clear();
   }
 
   // Commit delayed USM2M copies.

``````````

</details>


https://github.com/llvm/llvm-project/pull/186379


More information about the llvm-commits mailing list