]> git.ipfire.org Git - thirdparty/gcc.git/blame - libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-loop-and-seq-5.c
Use plain -fopenacc to enable OpenACC kernels processing
[thirdparty/gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-loop-and-seq-5.c
CommitLineData
5d7804a9
TV
1#include <stdlib.h>
2
3#define N 32
4
5unsigned int
6foo (int n, unsigned int *a)
7{
8 int r;
9#pragma acc kernels copyout(r) copy (a[0:N])
10 {
11 r = a[0];
12
13 for (int i = 0; i < n; i++)
14 a[i] = 1;
15 }
16
17 return r;
18}
19
20int
21main (void)
22{
23 unsigned int a[N];
24 unsigned res, i;
25
26 for (i = 0; i < N; ++i)
27 a[i] = i % 4;
28
29 res = foo (N, a);
30 if (res != 0)
31 abort ();
32
33 return 0;
34}