[Openmp-commits] [PATCH] D77603: [OpenMP] Sync writes to child thread's data before reduction

Bryan Chan via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Apr 14 11:51:10 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb86ff5f6efbe: [OpenMP] Sync writes to child thread's data before reduction (authored by bryanpkc).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77603/new/

https://reviews.llvm.org/D77603

Files:
  openmp/runtime/src/kmp_barrier.cpp


Index: openmp/runtime/src/kmp_barrier.cpp
===================================================================
--- openmp/runtime/src/kmp_barrier.cpp
+++ openmp/runtime/src/kmp_barrier.cpp
@@ -549,6 +549,7 @@
     if (((tid >> level) & (branch_factor - 1)) != 0) {
       kmp_int32 parent_tid = tid & ~((1 << (level + branch_bits)) - 1);
 
+      KMP_MB(); // Synchronize parent and child threads.
       KA_TRACE(20,
                ("__kmp_hyper_barrier_gather: T#%d(%d:%d) releasing T#%d(%d:%d) "
                 "arrived(%p): %llu => %llu\n",
@@ -590,6 +591,7 @@
       kmp_flag_64 c_flag(&child_bar->b_arrived, new_state);
       c_flag.wait(this_thr, FALSE USE_ITT_BUILD_ARG(itt_sync_obj));
       ANNOTATE_BARRIER_END(child_thr);
+      KMP_MB(); // Synchronize parent and child threads.
 #if USE_ITT_BUILD && USE_ITT_NOTIFY
       // Barrier imbalance - write min of the thread time and a child time to
       // the thread.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77603.257429.patch
Type: text/x-patch
Size: 933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200414/31448a9d/attachment.bin>


More information about the Openmp-commits mailing list