[llvm] [offload] add tests for event synchronization (PR #193927)

Kevin Sala Penades via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 10:02:46 PDT 2026


================
@@ -0,0 +1,22 @@
+#include <gpuintrin.h>
+#include <stdint.h>
+
+extern "C" __gpu_kernel void single_counter(int32_t init_loop, int32_t addend,
+                                            uint32_t *init_val, uint32_t *out) {
+
+  if (__gpu_thread_id(0) != 0) {
+    return;
+  }
+  
+  volatile int32_t counter = init_loop;
+
+  // We save the value at the beginning of the function in order to verify later
+  // whether the previously submitted kernel has finished before the new enqueue
----------------
kevinsala wrote:

```suggestion
  // whether the previously submitted kernel has finished before the new enqueue.
```

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


More information about the llvm-commits mailing list