summaryrefslogtreecommitdiff
path: root/test/correctness/tester.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-02-27 21:49:20 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-02-27 21:49:20 +0100
commitd6f1b5fca35414de4c31d4e0e280ca9987c062f1 (patch)
tree31ab536da3c72a99246ec7b903fb876583da4101 /test/correctness/tester.hpp
parent00281dad26c6e83ef39629cc26b24154f3219e06 (diff)
Added L2 error computation and checking for half-precision tests
Diffstat (limited to 'test/correctness/tester.hpp')
-rw-r--r--test/correctness/tester.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/correctness/tester.hpp b/test/correctness/tester.hpp
index 113f03ef..f60be04b 100644
--- a/test/correctness/tester.hpp
+++ b/test/correctness/tester.hpp
@@ -150,11 +150,20 @@ class Tester {
// template specialization)
// =================================================================================================
+// Error margins
+template <typename T> float getRelativeErrorMargin();
+template <typename T> float getAbsoluteErrorMargin();
+template <typename T> double getL2ErrorMargin();
+
// Compares two floating point values and returns whether they are within an acceptable error
// margin. This replaces GTest's EXPECT_NEAR().
template <typename T>
bool TestSimilarity(const T val1, const T val2);
+// Retrieves the squared difference, used for example for computing the L2 error
+template <typename T>
+double SquaredDifference(const T val1, const T val2);
+
// Retrieves a list of example scalar values, used for the alpha and beta arguments for the various
// routines. This function is specialised for the different data-types.
template <typename T>