From d6f1b5fca35414de4c31d4e0e280ca9987c062f1 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Mon, 27 Feb 2017 21:49:20 +0100 Subject: Added L2 error computation and checking for half-precision tests --- test/correctness/tester.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/correctness/tester.hpp') 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 float getRelativeErrorMargin(); +template float getAbsoluteErrorMargin(); +template double getL2ErrorMargin(); + // Compares two floating point values and returns whether they are within an acceptable error // margin. This replaces GTest's EXPECT_NEAR(). template bool TestSimilarity(const T val1, const T val2); +// Retrieves the squared difference, used for example for computing the L2 error +template +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 -- cgit v1.2.3