aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorMatthias Kretz <m.kretz@gsi.de>2023-02-21 10:43:13 +0100
committerMatthias Kretz <m.kretz@gsi.de>2023-05-25 09:04:02 +0200
commit1c588b53920227fe9f0388267eeb81bc2eb002f3 (patch)
tree30c3c363e9bb9e3ed549abbd4e2aa0023eeaa9a3 /libstdc++-v3
parenta2a953d11e80ac4b351bbaa4a8fa4e6b76de317c (diff)
libstdc++: Test that integral simd reductions are precise
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)
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc
index 1f20961825b..07ab50a2312 100644
--- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc
+++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc
@@ -114,6 +114,7 @@ template <typename V>
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);
});
}