diff --git a/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu b/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu --- a/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu +++ b/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_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);