[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
Mon Apr 13 11:17:50 PDT 2020


bryanpkc added a comment.

In D77603#1977658 <https://reviews.llvm.org/D77603#1977658>, @AndreyChurbanov wrote:

> Sorry, found one more issue.
>
> I think the first MB should be moved inside the block:
>
>   for (level...
>     if (((tid...


You are absolutely right about that. I have fixed the problem in the newest version.

Should I also add memory barriers to `__kmp_linear_barrier_gather_template`, `__kmp_tree_barrier_gather`, and `__kmp_hierarchical_barrier_gather`? They seem to suffer from the same problem on systems with weak memory order (but I don't have a handy test case to prove it).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77603





More information about the Openmp-commits mailing list