| 1 |
#ifdef __cplusplus |
| 2 |
extern "C" |
| 3 |
#endif |
| 4 |
void abort (void); |
| 5 |
|
| 6 |
int |
| 7 |
main () |
| 8 |
{ |
| 9 |
int a[64], b = 1; |
| 10 |
#pragma omp parallel num_threads (4) |
| 11 |
#pragma omp single |
| 12 |
{ |
| 13 |
int i; |
| 14 |
#pragma omp taskwait depend(in: a) nowait |
| 15 |
#pragma omp taskwait depend(in: a) nowait |
| 16 |
#pragma omp taskwait |
| 17 |
#pragma omp taskgroup |
| 18 |
{ |
| 19 |
#pragma omp taskwait depend(in: a) nowait |
| 20 |
#pragma omp taskwait depend(in: a) nowait |
| 21 |
} |
| 22 |
for (i = 0; i < 64; ++i) |
| 23 |
#pragma omp task depend(in: a) shared(a) |
| 24 |
a[i] = i; |
| 25 |
#pragma omp taskwait depend(inout: a) nowait |
| 26 |
for (i = 0; i < 64; ++i) |
| 27 |
#pragma omp task depend(inoutset: a) shared(a) |
| 28 |
if (a[i] != i) |
| 29 |
abort (); |
| 30 |
else |
| 31 |
a[i] = 2 * i + 1; |
| 32 |
#pragma omp taskwait nowait depend(out: a) depend(in: b) |
| 33 |
#pragma omp taskwait depend(inout: b) |
| 34 |
for (i = 0; i < 64; ++i) |
| 35 |
if (a[i] != 2 * i + 1) |
| 36 |
abort (); |
| 37 |
} |
| 38 |
return 0; |
| 39 |
} |