From: Gheorghe-Teodor Bercea Date: Mon, 3 Dec 2018 15:21:49 +0000 (+0000) Subject: [OpenMP][libomptarget] Flush intermediate values during team reduction X-Git-Tag: llvmorg-8.0.0-rc1~3052 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10b2e60b7e99dec7941758371a7684c324df22d6;p=platform%2Fupstream%2Fllvm.git [OpenMP][libomptarget] Flush intermediate values during team reduction Summary: Ensure intermediate values of a team reduction are flushed to memory. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, jfb, openmp-commits Differential Revision: https://reviews.llvm.org/D55219 llvm-svn: 348148 --- diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu b/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu index bbe4ad1..a9e35a1 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu @@ -444,6 +444,7 @@ EXTERN int32_t __kmpc_nvptx_teams_reduce_nowait_simple(kmp_Ident *loc, EXTERN void __kmpc_nvptx_teams_end_reduce_nowait_simple(kmp_Ident *loc, int32_t global_tid, kmp_CriticalName *crit) { + __threadfence_system(); (void)atomicExch((uint32_t *)crit, 0); }