3 /* float reductions. */
13 test_reductions (void)
19 for (i
= 0; i
< n
; i
++)
22 /* Gang reductions. */
23 check_reduction_op (float, +, 0, array
[i
], num_gangs (ng
), gang
);
24 check_reduction_op (float, *, 1, array
[i
], num_gangs (ng
), gang
);
26 /* Worker reductions. */
27 check_reduction_op (float, +, 0, array
[i
], num_workers (nw
), worker
);
28 check_reduction_op (float, *, 1, array
[i
], num_workers (nw
), worker
);
30 /* Vector reductions. */
31 check_reduction_op (float, +, 0, array
[i
], vector_length (vl
), vector
);
32 check_reduction_op (float, *, 1, array
[i
], vector_length (vl
), vector
);
34 /* Combined reductions. */
35 check_reduction_op (float, +, 0, array
[i
], num_gangs (ng
) num_workers (nw
)
36 vector_length (vl
), gang worker vector
);
37 check_reduction_op (float, *, 1, array
[i
], num_gangs (ng
) num_workers (nw
)
38 vector_length (vl
), gang worker vector
);
42 test_reductions_minmax (void)
48 for (i
= 0; i
< n
; i
++)
51 /* Gang reductions. */
52 check_reduction_macro (float, min
, n
+ 1, array
[i
], num_gangs (ng
), gang
);
53 check_reduction_macro (float, max
, -1, array
[i
], num_gangs (ng
), gang
);
55 /* Worker reductions. */
56 check_reduction_macro (float, min
, n
+ 1, array
[i
], num_workers (nw
),
58 check_reduction_macro (float, max
, -1, array
[i
], num_workers (nw
), worker
);
60 /* Vector reductions. */
61 check_reduction_macro (float, min
, n
+ 1, array
[i
], vector_length (vl
),
63 check_reduction_macro (float, max
, -1, array
[i
], vector_length (vl
), vector
);
65 /* Combined reductions. */
66 check_reduction_macro (float, min
, n
+ 1, array
[i
], num_gangs (ng
)
67 num_workers (nw
) vector_length (vl
), gang worker
69 check_reduction_macro (float, max
, -1, array
[i
], num_gangs (ng
)
70 num_workers (nw
)vector_length (vl
), gang worker
78 test_reductions_minmax ();