Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/ruy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjacob <benoitjacob@google.com>2021-02-09 00:31:22 +0300
committerCopybara-Service <copybara-worker@google.com>2021-02-09 00:31:47 +0300
commit287015c8ea2b2bbc7780f85650263a92518dcd37 (patch)
treea5e125adb4d2c75986c1d022b037d76f2f9f7f76
parent2887692065c38ef6617f423feafc6b69dd0a0681 (diff)
Update test tolerance ahead of merging PR #227
Closes https://github.com/google/ruy/pull/251 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ruy/pull/251 from bjacob:relax c8d2cf94d15abd4a9fd4222619c42413952f0fb1 PiperOrigin-RevId: 356340585
-rw-r--r--ruy/test.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/ruy/test.h b/ruy/test.h
index 42149a8..5aa4c41 100644
--- a/ruy/test.h
+++ b/ruy/test.h
@@ -1401,15 +1401,20 @@ bool Agree(ExternalPath external_path1, const Matrix<Scalar>& matrix1,
// 1 from using different rounding in right shifts, so the tolerance on
// the difference may have to be as large as 2.
tolerated_max_diff = 2;
- } else if (RUY_PLATFORM_ARM || RUY_PLATFORM_X86) {
- // All our code paths on ARM and x86, including SIMD paths, are bit-exact
+ } else if (RUY_PLATFORM_ARM) {
+ // All our code paths on ARM (32 and 64-bit) are bit-exact
// with the reference code (by design of the reference code).
tolerated_max_diff = 0;
+ } else if (RUY_PLATFORM_X86) {
+ // Our reference and ARM paths have diverged from x86 paths in PR #227.
+ // TODO: update the x86 path to adapt to that and reset that tolerance
+ // to 0.
+ tolerated_max_diff = 1;
} else {
- // In this case, we are comparing ruy paths only, but outside of ARM or
- // x86. At the moment, it so happens that ruy's x86 SIMD code paths are
- // bit exact with reference, but we allow for some tolerance on other
- // architectures.
+ // Other architectures, which we don't have dedicated code paths for
+ // at the moment.
+ // TODO: try resetting that tolerance to 0, since by
+ // definition we're only using non-optimized code paths here.
tolerated_max_diff = 1;
}