Commit 48c07461 authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

Adjust Zvmul test error threshold for mac-arm64

The threshold for the vector math Zvmul test is a little too tight for
mac-arm64.  Hence update the threshold from 1.5e-5 to 1.9e-5 but only
on mac-arm64.  We keep the threshold the same for other mac platforms
so we can catch any regressions there.

Bug: 1128434
Change-Id: Ib51fa772e27378fb8022e19790ecdfcf1e1a6e7c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2419539Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808951}
parent e4b2e6fd
...@@ -504,13 +504,20 @@ TEST_F(VectorMathTest, Zvmul) { ...@@ -504,13 +504,20 @@ TEST_F(VectorMathTest, Zvmul) {
// Different optimizations may use different precisions for intermediate // Different optimizations may use different precisions for intermediate
// results which may result in different rounding errors thus let's // results which may result in different rounding errors thus let's
// expect only mostly equal floats. // expect only mostly equal floats.
#if defined(OS_MAC)
#if defined(ARCH_CPU_ARM64)
const float threshold = 1.900e-5;
#else
const float threshold = 1.5e-5;
#endif
#endif
for (size_t i = 0u; i < real1.size(); ++i) { for (size_t i = 0u; i < real1.size(); ++i) {
if (std::isfinite(expected_dest_real[i])) { if (std::isfinite(expected_dest_real[i])) {
#if defined(OS_MAC) #if defined(OS_MAC)
// On Mac, OS provided vectorized functions are used which may result // On Mac, OS provided vectorized functions are used which may result
// in bigger rounding errors than functions used on other OSes. // in bigger rounding errors than functions used on other OSes.
EXPECT_NEAR(expected_dest_real[i], dest_real[i], EXPECT_NEAR(expected_dest_real[i], dest_real[i],
1e-5 * std::abs(expected_dest_real[i])); threshold * std::abs(expected_dest_real[i]));
#else #else
EXPECT_FLOAT_EQ(expected_dest_real[i], dest_real[i]); EXPECT_FLOAT_EQ(expected_dest_real[i], dest_real[i]);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment