1 /* Test of reduction on parallel directive (with async). */
2 /* See also Fortran variants in "../libgomp.oacc-fortran/par-reduction-2*". */
4 /* { dg-additional-options "-w" } */
10 main (int argc
, char *argv
[])
12 int res
, res1
= 0, res2
= 0;
14 #if defined(ACC_DEVICE_TYPE_host)
19 #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
20 reduction(+:res1) copy(res1, res2) async(1)
35 res
= res1
= res2
= 1;
37 #if defined(ACC_DEVICE_TYPE_host)
42 #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
43 reduction(*:res1) copy(res1, res2) async(1)
50 for (int i
= 0; i
< GANGS
; ++i
)
53 acc_async_wait_all ();