Mercurial > hg > CbC > CbC_gcc
annotate libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-4.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 #include <stdlib.h> |
2 | |
3 #define N 32 | |
4 | |
5 unsigned int | |
6 foo (int n, unsigned int *a) | |
7 { | |
8 #pragma acc kernels copy (a[0:N]) | |
9 { | |
10 a[0] = 2; | |
11 | |
12 for (int i = 0; i < n; i++) | |
13 a[i] = 1; | |
14 } | |
15 | |
16 return a[0]; | |
17 } | |
18 | |
19 int | |
20 main (void) | |
21 { | |
22 unsigned int a[N]; | |
23 unsigned res, i; | |
24 | |
25 for (i = 0; i < N; ++i) | |
26 a[i] = i % 4; | |
27 | |
28 res = foo (N, a); | |
29 if (res != 1) | |
30 abort (); | |
31 | |
32 return 0; | |
33 } |