7 int a
[64], i
, *p
= a
+ 4, x
= 0;
8 asm volatile ("" : "+r" (p
));
9 for (i
= 0; i
< 64; i
++)
11 #pragma omp parallel private (i)
13 #pragma omp single nowait
15 for (i
= 0; i
< 8; i
++)
17 #pragma omp task depend(out: a[i * 8 : 4])
18 a
[i
* 8] += (i
+ 2) * 9;
19 #pragma omp task depend(out: p[i * 8 : 2])
20 p
[i
* 8] += (i
+ 3) * 10;
21 #pragma omp task depend(out: x)
24 for (i
= 0; i
< 8; i
++)
25 #pragma omp task depend(in: a[i * 8 : 4]) \
26 depend(inout: a[i * 8 + 4 : 2]) \
27 depend(in: a[0 : 4]) depend(in: x)
29 if (a
[0] != 8 + 2 * 9 || x
!= 1)
31 if (a
[i
* 8] != i
* 8 + 8 + (i
+ 2) * 9)
33 if (a
[4 + i
* 8] != 4 + i
* 8 + 8 + (i
+ 3) * 10)
37 for (i
= 0; i
< 8; i
++)
38 #pragma omp task depend(inout: a[i * 8 : 4]) \
39 depend(in: p[i * 8 : 2]) \
40 depend(in: p[0 : 2], x)
42 if (p
[0] != 4 + 8 + 3 * 10 + 0 + 8 + 2 * 9 || x
!= 1)
44 if (a
[i
* 8] != i
* 8 + 8 + (i
+ 2) * 9)
46 if (a
[4 + i
* 8] != (4 + i
* 8 + 8 + (i
+ 3) * 10
47 + i
* 8 + 8 + (i
+ 2) * 9))
51 for (i
= 0; i
< 4; i
++)
52 #pragma omp task depend(in: a[i * 16 : 4], a[i * 16 + 8 : 4], x)
54 if (a
[i
* 16] != i
* 16 + 8 + (2 * i
+ 2) * 9 + 2 || x
!= 1)
56 if (p
[i
* 16 + 4] != i
* 16 + 8 + 8 + (2 * i
+ 1 + 2) * 9 + 2)