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

Piotr Balcer via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 05:07:40 PDT 2026


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

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.

>From d29252e0d370dfa218f2dbe10dce1a68e8085e56 Mon Sep 17 00:00:00 2001
From: Piotr Balcer <piotr.balcer at intel.com>
Date: Fri, 13 Mar 2026 12:22:31 +0000
Subject: [PATCH] [Offload][L0] clear completed events from a wait list

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.
---
 offload/plugins-nextgen/level_zero/src/L0Device.cpp | 3 +++
 1 file changed, 3 insertions(+)

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.



More information about the llvm-commits mailing list