sched1: debug/model: dump predecessor list and BB num [NFC]
[gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-loop-clauses.c
blob2c424973eb1716cfea17ccd141694dfbf0dbe329
1 /* Exercise the auto, independent, seq and tile loop clauses inside
2 kernels regions. */
4 #include <assert.h>
6 #define N 100
8 void
9 check (int *a, int *b)
11 int i;
13 for (i = 0; i < N; i++)
14 assert (a[i] == b[i]);
17 int
18 main ()
20 int i, a[N], b[N];
22 #pragma acc kernels copy(a)
24 #pragma acc loop auto
25 for (i = 0; i < N; i++)
26 a[i] = i;
29 for (i = 0; i < N; i++)
30 b[i] = i;
32 check (a, b);
34 #pragma acc kernels copyout(a)
36 #pragma acc loop independent
37 for (i = 0; i < N; i++)
38 a[i] = i;
41 check (a, b);
43 #pragma acc kernels present_or_copy(a)
45 #pragma acc loop seq
46 for (i = 0; i < N; i++)
47 a[i] = i;
50 check (a, b);
52 #pragma acc kernels pcopyout(a) present_or_copyin(b)
54 #pragma acc loop seq
55 for (i = 0; i < N; i++)
56 a[i] = b[i];
59 check (a, b);
61 return 0;