]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-wv-1.c
2 /* { dg-additional-options "-O2" } */
6 #include <gomp-constants.h>
8 #define N (32*32*32+17)
15 #pragma acc parallel num_workers(32) vector_length(32) copy(ondev)
17 #pragma acc loop worker vector reduction (+:t)
18 for (unsigned ix
= 0; ix
< N
; ix
++)
22 if (acc_on_device (acc_device_not_host
))
26 g
= __builtin_goacc_parlevel_id (GOMP_DIM_GANG
);
27 w
= __builtin_goacc_parlevel_id (GOMP_DIM_WORKER
);
28 v
= __builtin_goacc_parlevel_id (GOMP_DIM_VECTOR
);
29 val
= (g
<< 16) | (w
<< 8) | v
;
36 for (ix
= 0; ix
< N
; ix
++)
42 int w
= (ix
/ 32) % 32;
45 val
= (g
<< 16) | (w
<< 8) | v
;
51 printf ("t=%x expected %x\n", t
, h
);