[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 08:07:26 PDT 2018

ABataev added a comment.

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

> In https://reviews.llvm.org/D51875#1249092, @ABataev wrote:
> > In https://reviews.llvm.org/D51875#1249088, @ABataev wrote:
> >
> > >
> >
> I don't see why the distribute loop cares which thread actually executes the last iteration of the `for` loop, that's only relevant in the outlined parallel region.

Because it marks as lastprivate not the last loop chunk executed by the last thread, but the set of loop chunks executed by the last team. It means that when you try to write the lastprivate value after the distribute loop you will have multiple writes from the different threads with the different values of lastprivates.



More information about the Openmp-commits mailing list