3 /* Ignore vector_length warnings for offloaded (nvptx) targets. */
4 /* { dg-additional-options "-foffload=-w" } */
6 /* float reductions. */
16 test_reductions (void)
22 for (i
= 0; i
< n
; i
++)
25 /* Gang reductions. */
26 check_reduction_op (float, +, 0, array
[i
], num_gangs (ng
), gang
);
27 check_reduction_op (float, *, 1, array
[i
], num_gangs (ng
), gang
);
29 /* Worker reductions. */
30 check_reduction_op (float, +, 0, array
[i
], num_workers (nw
), worker
);
31 check_reduction_op (float, *, 1, array
[i
], num_workers (nw
), worker
);
33 /* Vector reductions. */
34 check_reduction_op (float, +, 0, array
[i
], vector_length (vl
), vector
);
35 check_reduction_op (float, *, 1, array
[i
], vector_length (vl
), vector
);
37 /* Combined reductions. */
38 check_reduction_op (float, +, 0, array
[i
], num_gangs (ng
) num_workers (nw
)
39 vector_length (vl
), gang worker vector
);
40 check_reduction_op (float, *, 1, array
[i
], num_gangs (ng
) num_workers (nw
)
41 vector_length (vl
), gang worker vector
);
45 test_reductions_minmax (void)
51 for (i
= 0; i
< n
; i
++)
54 /* Gang reductions. */
55 check_reduction_macro (float, min
, n
+ 1, array
[i
], num_gangs (ng
), gang
);
56 check_reduction_macro (float, max
, -1, array
[i
], num_gangs (ng
), gang
);
58 /* Worker reductions. */
59 check_reduction_macro (float, min
, n
+ 1, array
[i
], num_workers (nw
),
61 check_reduction_macro (float, max
, -1, array
[i
], num_workers (nw
), worker
);
63 /* Vector reductions. */
64 check_reduction_macro (float, min
, n
+ 1, array
[i
], vector_length (vl
),
66 check_reduction_macro (float, max
, -1, array
[i
], vector_length (vl
), vector
);
68 /* Combined reductions. */
69 check_reduction_macro (float, min
, n
+ 1, array
[i
], num_gangs (ng
)
70 num_workers (nw
) vector_length (vl
), gang worker
72 check_reduction_macro (float, max
, -1, array
[i
], num_gangs (ng
)
73 num_workers (nw
)vector_length (vl
), gang worker
81 test_reductions_minmax ();