aboutsummaryrefslogtreecommitdiff
path: root/libomptarget/deviceRTLs/nvptx/src/libcall.cu
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-04-26 19:30:34 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-04-26 19:30:34 +0000
commit867a57389a1512800a2b2bdff6967f0978d398d6 (patch)
treef0cf09e44d2bbe8662498803026995d59754f5c9 /libomptarget/deviceRTLs/nvptx/src/libcall.cu
parent777f60f39b80b52f0b3ce3f2aa1af5ffb7aaf7bc (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@359341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'libomptarget/deviceRTLs/nvptx/src/libcall.cu')
-rw-r--r--libomptarget/deviceRTLs/nvptx/src/libcall.cu2
1 files changed, 1 insertions, 1 deletions
diff --git a/libomptarget/deviceRTLs/nvptx/src/libcall.cu b/libomptarget/deviceRTLs/nvptx/src/libcall.cu
index 9bc3f2c..c3877a8 100644
--- a/libomptarget/deviceRTLs/nvptx/src/libcall.cu
+++ b/libomptarget/deviceRTLs/nvptx/src/libcall.cu
@@ -165,7 +165,7 @@ EXTERN int omp_get_level(void) {
ASSERT0(LT_FUSSY, isSPMDMode(),
"Expected SPMD mode only with uninitialized runtime.");
// parallelLevel starts from 0, need to add 1 for correct level.
- return parallelLevel + 1;
+ return parallelLevel[GetWarpId()] + 1;
}
int level = 0;
omptarget_nvptx_TaskDescr *currTaskDescr =