1 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
2 aspects of that functionality. */
4 /* Multiple reductions. */
15 #define DO_PRAGMA(x) _Pragma (#x) /* { dg-line pragma_loc } */
17 #define check_reduction(gwv_par, gwv_loop) \
20 DO_PRAGMA (acc parallel gwv_par copy (s1, s2)) /* { dg-line DO_PRAGMA_loc } */ \
21 DO_PRAGMA (acc loop gwv_loop reduction (+:s1, s2)) \
22 for (i = 0; i < n; i++) \
28 if (s1 != v1 && s2 != v2) \
35 int s1
= 2, s2
= 5, v1
= 2, v2
= 5;
38 for (i
= 0; i
< n
; i
++)
44 check_reduction (num_gangs (ng
), gang
);
46 /* Nvptx targets require a vector_length or 32 in to allow spinlocks with
48 check_reduction (num_workers (nw
) vector_length (vl
), worker
); /* { dg-line check_reduction_loc } */
49 /* { dg-warning "22:region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } pragma_loc }
50 { dg-note "1:in expansion of macro 'DO_PRAGMA'" "" { target *-*-* xfail offloading_enabled } DO_PRAGMA_loc }
51 { dg-note "3:in expansion of macro 'check_reduction'" "" { target *-*-* xfail offloading_enabled } check_reduction_loc }
52 TODO See PR101551 for 'offloading_enabled' XFAILs. */
53 check_reduction (vector_length (vl
), vector
);
54 check_reduction (num_gangs (ng
) num_workers (nw
) vector_length (vl
), gang