[Openmp-commits] [PATCH] D95550: [OpenMP][deviceRTLs] Added `[[clang::loader_uninitialized]]` explicitly
Shilei Tian via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jan 28 05:13:09 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG19248d30e4ed: [OpenMP][deviceRTLs] Added `[[clang::loader_uninitialized]]` explicitly (authored by tianshilei1992).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95550/new/
https://reviews.llvm.org/D95550
Files:
openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
Index: openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
===================================================================
--- openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
+++ openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
@@ -25,7 +25,8 @@
// global data holding OpenMP state information
////////////////////////////////////////////////////////////////////////////////
-DEVICE
+// OpenMP will try to call its ctor if we don't add the attribute explicitly
+[[clang::loader_uninitialized]] DEVICE
omptarget_nvptx_Queue<omptarget_nvptx_ThreadPrivateContext, OMP_STATE_COUNT>
omptarget_nvptx_device_State[MAX_SM];
@@ -33,7 +34,9 @@
DEVICE uint32_t SHARED(usedMemIdx);
DEVICE uint32_t SHARED(usedSlotIdx);
-DEVICE uint8_t parallelLevel[MAX_THREADS_PER_TEAM / WARPSIZE];
+// SHARED doesn't work with array so we add the attribute explicitly.
+[[clang::loader_uninitialized]] DEVICE uint8_t
+ parallelLevel[MAX_THREADS_PER_TEAM / WARPSIZE];
#pragma omp allocate(parallelLevel) allocator(omp_pteam_mem_alloc)
DEVICE uint16_t SHARED(threadLimit);
DEVICE uint16_t SHARED(threadsInTeam);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95550.319834.patch
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210128/f2c37c05/attachment.bin>
More information about the Openmp-commits
mailing list