[Openmp-commits] [openmp] d7fdd23 - [OpenMP][Tests][NFC] Replace atomic increment by reduction

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 25 09:23:21 PDT 2021


Author: Joachim Protze
Date: 2021-10-25T18:20:12+02:00
New Revision: d7fdd236d59f5850a1205929dae5a9e26a6b8c0b

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

LOG: [OpenMP][Tests][NFC] Replace atomic increment by reduction

Also mark the test as unsupported by intel-21, because the test does
not terminate

Added: 
    

Modified: 
    openmp/runtime/test/worksharing/for/omp_for_bigbounds.c

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c b/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c
index adc00ff45386..c6f1693a8d22 100644
--- a/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c
+++ b/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c
@@ -7,6 +7,9 @@
 
 // XFAIL: gcc, clang-3, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
 
+// icc 21 seems to have an issue with the loop boundaries and runs very long
+// UNSUPPORTED: icc-21
+
 /*
  * Test that large bounds are handled properly and calculations of
  * loop iterations don't accidentally overflow
@@ -17,8 +20,8 @@
 #include <limits.h>
 #include "omp_testsuite.h"
 
-#define INCR 50000000
-#define MY_MAX 2000000000
+#define INCR      50000000
+#define MY_MAX  2000000000
 #define MY_MIN -2000000000
 #ifndef MY_SCHEDULE
 # define MY_SCHEDULE static
@@ -33,14 +36,12 @@ int test_omp_for_bigbounds()
   #pragma omp parallel
   {
     int i;
-    #pragma omp for schedule(MY_SCHEDULE)
+    #pragma omp for schedule(MY_SCHEDULE) reduction(+:a)
     for (i = INT_MIN; i < MY_MAX; i+=INCR) {
-        #pragma omp atomic
         a++;
     }
-    #pragma omp for schedule(MY_SCHEDULE)
+    #pragma omp for schedule(MY_SCHEDULE) reduction(+:b)
     for (i = INT_MAX; i >= MY_MIN; i-=INCR) {
-        #pragma omp atomic
         b++;
     }
   }


        


More information about the Openmp-commits mailing list