Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:
* testsuite/experimental/simd/tests/reductions.cc: Introduce
max_distance as the type-dependent max error.
(cherry picked from commit
8fda668e0919af9ceda9435f02a1708b375b2913)
T acc = x[0];
for (size_t i = 1; i < V::size(); ++i)
acc += x[i];
- ULP_COMPARE(reduce(x), acc, V::size() / 2).on_failure("x = ", x);
+ const T max_distance = std::is_integral_v<T> ? 0 : V::size() / 2;
+ ULP_COMPARE(reduce(x), acc, max_distance).on_failure("x = ", x);
});
}