Update 'Q' constraint documentation.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / pr85486-3.c
bloba959b90c29ad99db0790a2bfd39120d927e7114a
1 /* { dg-do run { target openacc_nvidia_accel_selected } } */
2 /* { dg-set-target-env-var "GOMP_OPENACC_DIM" "::128" } */
4 /* Minimized from ref-1.C. */
6 #include <stdio.h>
8 #pragma acc routine vector
9 void __attribute__((noinline, noclone))
10 Vector (int *ptr, int n, const int inc)
12 #pragma acc loop vector
13 for (unsigned ix = 0; ix < n; ix++)
14 ptr[ix] += inc;
17 int
18 main (void)
20 const int n = 32, m=32;
22 int ary[m][n];
23 unsigned ix, iy;
25 for (ix = m; ix--;)
26 for (iy = n; iy--;)
27 ary[ix][iy] = (1 << 16) + (ix << 8) + iy;
29 int err = 0;
31 #pragma acc parallel copy (ary)
33 Vector (&ary[0][0], m * n, (1 << 24) - (1 << 16));
36 for (ix = m; ix--;)
37 for (iy = n; iy--;)
38 if (ary[ix][iy] != ((1 << 24) + (ix << 8) + iy))
40 printf ("ary[%u][%u] = %x expected %x\n",
41 ix, iy, ary[ix][iy], ((1 << 24) + (ix << 8) + iy));
42 err++;
45 if (err)
47 printf ("%d failed\n", err);
48 return 1;
51 return 0;
54 /* { dg-prune-output "using vector_length \\(32\\), ignoring runtime setting" } */