[Openmp-commits] [openmp] c93fb14 - [OpenMP][Tests][NFC] Work around ICC bug

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 18 04:54:56 PDT 2021


Author: Joachim Protze
Date: 2021-10-18T13:54:15+02:00
New Revision: c93fb143b98ea2035c6fca95241bc5ba40faf97e

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

LOG: [OpenMP][Tests][NFC] Work around ICC bug
Older intel compilers miss the privatization of nested loop variables for
doacross loops. Declaring the variable in the loop makes the test more
robust.

Added: 
    

Modified: 
    openmp/runtime/test/ompt/synchronization/ordered_dependences.c

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/test/ompt/synchronization/ordered_dependences.c b/openmp/runtime/test/ompt/synchronization/ordered_dependences.c
index dc9f0824d9150..c3c64712e5e9e 100644
--- a/openmp/runtime/test/ompt/synchronization/ordered_dependences.c
+++ b/openmp/runtime/test/ompt/synchronization/ordered_dependences.c
@@ -6,11 +6,10 @@
 
 int main() {
   int a[10][10];
-  int i, j;
 #pragma omp parallel num_threads(2)
 #pragma omp for ordered(2)
-  for (i = 0; i < 2; i++)
-    for (j = 0; j < 2; j++) {
+  for (int i = 0; i < 2; i++)
+    for (int j = 0; j < 2; j++) {
       a[i][j] = i + j + 1;
       printf("%d, %d\n", i, j);
 #pragma omp ordered depend(sink : i - 1, j) depend(sink : i, j - 1)


        


More information about the Openmp-commits mailing list