[libclc] baac39c - libclc: Add amdgpu wait_group_events (#185177)

via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 7 15:28:55 PST 2026


Author: Matt Arsenault
Date: 2026-03-08T00:28:51+01:00
New Revision: baac39c0d2a46a1ff6d810168bd6277008fbd0bf

URL: https://github.com/llvm/llvm-project/commit/baac39c0d2a46a1ff6d810168bd6277008fbd0bf
DIFF: https://github.com/llvm/llvm-project/commit/baac39c0d2a46a1ff6d810168bd6277008fbd0bf.diff

LOG: libclc: Add amdgpu wait_group_events (#185177)

Added: 
    libclc/opencl/lib/amdgcn/async/wait_group_events.cl

Modified: 
    libclc/opencl/lib/amdgcn/SOURCES

Removed: 
    


################################################################################
diff  --git a/libclc/opencl/lib/amdgcn/SOURCES b/libclc/opencl/lib/amdgcn/SOURCES
index e52f54789bfab..c9d29fb2d1905 100644
--- a/libclc/opencl/lib/amdgcn/SOURCES
+++ b/libclc/opencl/lib/amdgcn/SOURCES
@@ -1,3 +1,4 @@
+async/wait_group_events.cl
 mem_fence/fence.cl
 subgroup/subgroup.cl
 synchronization/sub_group_barrier.cl

diff  --git a/libclc/opencl/lib/amdgcn/async/wait_group_events.cl b/libclc/opencl/lib/amdgcn/async/wait_group_events.cl
new file mode 100644
index 0000000000000..fac33f73af1c4
--- /dev/null
+++ b/libclc/opencl/lib/amdgcn/async/wait_group_events.cl
@@ -0,0 +1,23 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <clc/opencl/opencl-base.h>
+
+_CLC_DEF _CLC_OVERLOAD void wait_group_events(int n, __private event_t *evs) {
+  (void)n;
+  (void)evs;
+  work_group_barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE,
+                     memory_scope_work_group);
+}
+
+_CLC_DEF _CLC_OVERLOAD void wait_group_events(int n, __generic event_t *evs) {
+  (void)n;
+  (void)evs;
+  work_group_barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE,
+                     memory_scope_work_group);
+}


        


More information about the cfe-commits mailing list