max_error in CBasicTestFetchAdd and CBasicTestFetchSub is the spread of five fixed summation orders, but the expected and tested sums use other orders (index order and thread arrival order), so a correct result can exceed it. Example with atomic_fetch_add -host (host threads only), float, 16 elements: difference 0.000732421875 (3 ulp), max_error 0.00048828125 (2 ulp).
Proposal: use the Higham worst case summation bound, as the work_group_reduce_* tests already do in test_wg_scan_reduce.cpp: Reduce::generate_input_values.
max_errorinCBasicTestFetchAddandCBasicTestFetchSubis the spread of five fixed summation orders, but the expected and tested sums use other orders (index order and thread arrival order), so a correct result can exceed it. Example withatomic_fetch_add -host(host threads only), float, 16 elements: difference 0.000732421875 (3 ulp),max_error0.00048828125 (2 ulp).Proposal: use the Higham worst case summation bound, as the
work_group_reduce_*tests already do intest_wg_scan_reduce.cpp:Reduce::generate_input_values.