[Openmp-commits] [llvm] [openmp] [OpenMP] Publish target-init team state with acq_rel barrier (PR #208701)

Abid Qadeer via Openmp-commits openmp-commits at lists.llvm.org
Fri Jul 10 08:32:55 PDT 2026


================
@@ -112,7 +112,7 @@ int32_t __kmpc_target_init(KernelEnvironmentTy &KernelEnvironment,
   if (IsSPMD) {
     initializeRuntime(/*IsSPMD=*/true, KernelEnvironment,
                       KernelLaunchEnvironment);
-    synchronize::threadsAligned(atomic::relaxed);
+    synchronize::threadsAligned(atomic::acq_rel);
----------------
abidh wrote:

I checked and there's no prior fence that flushes the initialization. In `initializeRuntime`, the team-state writes happen only on the initial thread inside state::init (TeamState.init, ThreadStates = nullptr, etc., all plain stores). The only steps between those stores and the `threadsAligned` call are the remaining plain-store assignments in `state::init` and `workshare::init` (`ThreadDST = nullptr`). There is no fence.

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


More information about the Openmp-commits mailing list