[Openmp-commits] [openmp] 2d911f7 - [OpenMP] Fix atomic entries for captured logical operation

Hansang Bae via Openmp-commits openmp-commits at lists.llvm.org
Tue Jan 19 08:15:00 PST 2021


Author: Hansang Bae
Date: 2021-01-19T09:59:28-06:00
New Revision: 2d911f7c72f9174a34f74abe2909f992b03caaf1

URL: https://github.com/llvm/llvm-project/commit/2d911f7c72f9174a34f74abe2909f992b03caaf1
DIFF: https://github.com/llvm/llvm-project/commit/2d911f7c72f9174a34f74abe2909f992b03caaf1.diff

LOG: [OpenMP] Fix atomic entries for captured logical operation

Added missing code for the captured atomic operation.

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

Added: 
    

Modified: 
    openmp/runtime/src/kmp_atomic.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_atomic.cpp b/openmp/runtime/src/kmp_atomic.cpp
index 4d60b550ae62..a9d5257ab2aa 100644
--- a/openmp/runtime/src/kmp_atomic.cpp
+++ b/openmp/runtime/src/kmp_atomic.cpp
@@ -2536,8 +2536,11 @@ ATOMIC_CRITICAL_CPT_MIX(float10, long double, div_cpt, /, fp, _Quad, 10r,
                                                                                \
   if (flag) {                                                                  \
     new_value OP rhs;                                                          \
-  } else                                                                       \
+    (*lhs) = new_value;                                                        \
+  } else {                                                                     \
     new_value = (*lhs);                                                        \
+    (*lhs) OP rhs;                                                             \
+  }                                                                            \
                                                                                \
   __kmp_release_atomic_lock(&ATOMIC_LOCK##LCK_ID, gtid);
 


        


More information about the Openmp-commits mailing list