From d7fdd236d59f5850a1205929dae5a9e26a6b8c0b Mon Sep 17 00:00:00 2001 From: Joachim Protze Date: Mon, 25 Oct 2021 16:02:31 +0200 Subject: [PATCH] [OpenMP][Tests][NFC] Replace atomic increment by reduction Also mark the test as unsupported by intel-21, because the test does not terminate --- openmp/runtime/test/worksharing/for/omp_for_bigbounds.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c b/openmp/runtime/test/worksharing/for/omp_for_bigbounds.c index adc00ff..c6f1693a 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 #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++; } } -- 2.7.4