[OPENMP][NVPTX]Correctly handle L2 parallelism in SPMD mode.
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 26 Apr 2019 19:30:34 +0000 (19:30 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 26 Apr 2019 19:30:34 +0000 (19:30 +0000)
commitc03fe73176067a2eb2ed5aca8ec685b6ea931b30
tree13695f7e3054e3800348bef0d4460b141b3f8d88
parent5ddc6d180cd660fa1b70e0c251a95b70ad743ac9
[OPENMP][NVPTX]Correctly handle L2 parallelism in SPMD mode.

Summary:
The parallelLevel counter must be on per-thread basis to fully support
L2+ parallelism, otherwise we may end up with undefined behavior.
Introduce the parallelLevel on per-warp basis using shared memory. It
allows to avoid the problems with the synchronization and allows fully
support L2+ parallelism in SPMD mode with no runtime.

Reviewers: gtbercea, grokos

Subscribers: guansong, jdoerfert, caomhin, kkwli0, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D60918

llvm-svn: 359341
openmp/libomptarget/deviceRTLs/nvptx/src/libcall.cu
openmp/libomptarget/deviceRTLs/nvptx/src/omp_data.cu
openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
openmp/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
openmp/libomptarget/deviceRTLs/nvptx/src/parallel.cu
openmp/libomptarget/deviceRTLs/nvptx/src/support.h
openmp/libomptarget/deviceRTLs/nvptx/src/supporti.h
openmp/libomptarget/deviceRTLs/nvptx/test/parallel/spmd_parallel_regions.cpp