[llvm] [Offload] Verify SyncCycle for events in AMDGPU (PR #149524)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 18 08:06:59 PDT 2025
================
@@ -1665,6 +1665,11 @@ Error AMDGPUStreamTy::waitEvent(const AMDGPUEventTy &Event) {
Error AMDGPUStreamTy::synchronizeOn(AMDGPUEventTy &Event) {
std::lock_guard<std::mutex> Lock(Mutex);
+ // If this event was for an older sync cycle, it has already been finalized
+ if (Event.RecordedSyncCycle < SyncCycle)
----------------
RossBrunton wrote:
That, or if a later event gets consumed before an earlier one. If the latest event in the queue is synced on, the queue is reset and SyncCycle incremented.
https://github.com/llvm/llvm-project/pull/149524
More information about the llvm-commits
mailing list