public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6302] libstdc++: Test that integral simd reductions are precise
@ 2023-02-23 14:04 Matthias Kretz
  0 siblings, 0 replies; only message in thread
From: Matthias Kretz @ 2023-02-23 14:04 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:8fda668e0919af9ceda9435f02a1708b375b2913

commit r13-6302-g8fda668e0919af9ceda9435f02a1708b375b2913
Author: Matthias Kretz <m.kretz@gsi.de>
Date:   Tue Feb 21 10:43:13 2023 +0100

    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.

Diff:
---
 libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc
index 0c4c79feb20..fed164314d7 100644
--- a/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc
+++ b/libstdc++-v3/testsuite/experimental/simd/tests/reductions.cc
@@ -112,6 +112,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);
     });
   }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-23 14:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 14:04 [gcc r13-6302] libstdc++: Test that integral simd reductions are precise Matthias Kretz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).