Skip to content

Commit c93fb14

Browse files
committed
[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.
1 parent 5918688 commit c93fb14

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
int main() {
88
int a[10][10];
9-
int i, j;
109
#pragma omp parallel num_threads(2)
1110
#pragma omp for ordered(2)
12-
for (i = 0; i < 2; i++)
13-
for (j = 0; j < 2; j++) {
11+
for (int i = 0; i < 2; i++)
12+
for (int j = 0; j < 2; j++) {
1413
a[i][j] = i + j + 1;
1514
printf("%d, %d\n", i, j);
1615
#pragma omp ordered depend(sink : i - 1, j) depend(sink : i, j - 1)

0 commit comments

Comments
 (0)