Set num_threads to 50 on 32-bit hppa in two libgomp loop tests
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / deep-copy-9.c
blobe86a46bd84a7ee15da6ebe805c24a31397ef00e9
1 #include <stdlib.h>
3 typedef struct {
4 int *a;
5 int *b;
6 } mystruct;
8 int
9 main (int argc, char* argv[])
11 const int N = 1024;
12 mystruct *m = (mystruct *) malloc (sizeof (*m));
13 int i;
15 m->a = (int *) malloc (N * sizeof (int));
16 m->b = (int *) malloc (N * sizeof (int));
18 for (i = 0; i < N; i++)
20 m->a[i] = 0;
21 m->b[i] = 0;
24 #pragma acc enter data copyin(m[0:1])
26 for (int i = 0; i < 99; i++)
28 int j;
29 int *ptr = m->a;
30 #pragma acc parallel loop copy(m->a[0:N])
31 for (j = 0; j < N; j++)
32 m->a[j]++;
33 #pragma acc parallel loop copy(m->b[0:N])
34 for (j = 0; j < N; j++)
35 m->b[j]++;
38 #pragma acc exit data copyout(m[0:1])
40 for (i = 0; i < N; i++)
42 if (m->a[i] != 99)
43 abort ();
44 if (m->b[i] != 99)
45 abort ();
48 free (m->a);
49 free (m->b);
50 free (m);
52 return 0;