[Openmp-commits] [openmp] [OFFLOAD] Add spirv implementation for named barrier (PR #180393)

via Openmp-commits openmp-commits at lists.llvm.org
Sat Feb 7 23:21:07 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- openmp/device/src/Synchronization.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/openmp/device/src/Synchronization.cpp b/openmp/device/src/Synchronization.cpp
index 7a065b0a2..1053ccf0e 100644
--- a/openmp/device/src/Synchronization.cpp
+++ b/openmp/device/src/Synchronization.cpp
@@ -190,7 +190,7 @@ void namedBarrierInit() {
 
 void namedBarrier() {
   uint32_t NumThreads = omp_get_num_threads();
-  
+
   // Uses two 16 bit unsigned counters. One for the number of threads to have
   // reached the barrier, and one to count how many times the barrier has been
   // passed. These are packed in a single atomically accessed 32 bit integer.
@@ -199,8 +199,7 @@ void namedBarrier() {
 
   // Increment the low 16 bits once.
 
-  uint32_t load = atomic::add(&namedBarrierTracker, 1,
-                              atomic::seq_cst); 
+  uint32_t load = atomic::add(&namedBarrierTracker, 1, atomic::seq_cst);
 
   // Record the number of times the barrier has been passed
   uint32_t generation = load & 0xffff0000u;
@@ -220,7 +219,6 @@ void namedBarrier() {
     } while ((load & 0xffff0000u) == generation);
   }
   __gpu_sync_threads();
-
 }
 
 void unsetLock(omp_lock_t *Lock) {

``````````

</details>


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


More information about the Openmp-commits mailing list