[Openmp-commits] [PATCH] D51875: [OPENMP][NVPTX] Add support for lastprivates/reductions handling in SPMD constructs with lightweight runtime.

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 28 07:30:17 PDT 2018

ABataev added a comment.

In https://reviews.llvm.org/D51875#1249034, @Hahnfeld wrote:

> In https://reviews.llvm.org/D51875#1249019, @ABataev wrote:
> >
> Yes, that's the current solution in Clang and actually what I described above:
> In https://reviews.llvm.org/D51875#1248997, @Hahnfeld wrote:
> > In SPMD constructs all CUDA threads are executing the `distribute` loop, but only the thread executing the last iteration of the `for` loop has seen the `lastprivate` value. However the information of which thread this is has been lost at the end of the `parallel` region. So data sharing is used to communicate the `lastprivate` value to all threads in the team that is executing the last `distribute` chunk.
> I'm assuming that the pointer returned by `/* get data sharing frame from runtime */` is shared between all threads in a team.

1. It is not how clang works, it is how standard requires.
2. Yes, it is shared between all the threads in the team and this is how it is intended to be according to the standard



More information about the Openmp-commits mailing list