[Openmp-commits] [PATCH] D40175: Fix for OMP doacross implementation on Power

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 17 07:12:16 PST 2017


Hahnfeld added inline comments.


================
Comment at: runtime/src/kmp_csupport.cpp:3813-3823
+    flags = (kmp_uint32 *)__kmp_thread_calloc(th, size, 1);
+    KMP_MB();
+    sh_buf->doacross_flags = flags;
   } else if ((kmp_int64)flags == 1) {
     // initialization is still in progress, need to wait
     while ((volatile kmp_int64)sh_buf->doacross_flags == 1) {
       KMP_YIELD(TRUE);
----------------
I'm not really sure if these memory barriers are needed, ie I haven't seen the test fail without them. I put them in because I think that all threads need to see the zeroed memory in `flags`


https://reviews.llvm.org/D40175





More information about the Openmp-commits mailing list