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

github.com/marian-nmt/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2020-03-04 23:20:59 +0300
committerKenneth Heafield <github@kheafield.com>2020-03-04 23:20:59 +0300
commitcb1e96c069083507da1278d85ddd890ae15304c8 (patch)
tree05327cf89aee7492c4c9689c38477dc3c50505c8
parentaa174e619583552dcbd9690af961e11ab75c24e2 (diff)
Get at least the PrepareA tests working
-rw-r--r--test/test.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test.h b/test/test.h
index a1ca724..ac4a8f6 100644
--- a/test/test.h
+++ b/test/test.h
@@ -38,7 +38,9 @@ template <typename Type>
void CompareEps(const Type* reference, const Type* actual, Index size, Type epsilon) {
for (Index i = 0; i < size; ++i) {
INFO("Inaccurate at " << i << ' ' << reference[i] << ' ' << actual[i]);
- CHECK(fabs(reference[i] - actual[i]) < epsilon);
+ // Ratio to maximum value.
+ float threshold = epsilon * std::max(0.01f, fabs(reference[i]));
+ CHECK(fabs(reference[i] - actual[i]) < threshold);
}
}