1 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
2 aspects of that functionality. */
6 /* Test of reduction on parallel directive. */
8 #define ACTUAL_GANGS 256
11 main (int argc
, char *argv
[])
13 int res
, res1
= 0, res2
= 0;
15 #if defined(ACC_DEVICE_TYPE_host)
20 #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
21 reduction(+:res1) copy(res2, res1)
22 /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail { ! openacc_host_selected } } .-2 } */
23 /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-3 } */
24 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-4 } */
37 res
= res1
= res2
= 1;
39 #if defined(ACC_DEVICE_TYPE_host)
44 #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
45 reduction(*:res1) copy(res1, res2)
46 /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail { ! openacc_host_selected } } .-2 } */
47 /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-3 } */
48 /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-4 } */
55 for (int i
= 0; i
< GANGS
; ++i
)