summaryrefslogtreecommitdiff
path: root/test/correctness
diff options
context:
space:
mode:
Diffstat (limited to 'test/correctness')
-rw-r--r--test/correctness/routines/levelx/xinvert.cpp30
-rw-r--r--test/correctness/testblas.cpp5
-rw-r--r--test/correctness/tester.cpp4
3 files changed, 38 insertions, 1 deletions
diff --git a/test/correctness/routines/levelx/xinvert.cpp b/test/correctness/routines/levelx/xinvert.cpp
new file mode 100644
index 00000000..0ccc0829
--- /dev/null
+++ b/test/correctness/routines/levelx/xinvert.cpp
@@ -0,0 +1,30 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// =================================================================================================
+
+#include "test/correctness/testblas.hpp"
+#include "test/routines/levelx/xinvert.hpp"
+
+// Shortcuts to the clblast namespace
+using float2 = clblast::float2;
+using double2 = clblast::double2;
+
+// Main function (not within the clblast namespace)
+int main(int argc, char *argv[]) {
+ auto errors = size_t{0};
+ errors += clblast::RunTests<clblast::TestXinvert<float>, float, float>(argc, argv, false, "SINVERT");
+ errors += clblast::RunTests<clblast::TestXinvert<double>, double, double>(argc, argv, true, "DINVERT");
+ errors += clblast::RunTests<clblast::TestXinvert<float2>, float2, float2>(argc, argv, true, "CINVERT");
+ errors += clblast::RunTests<clblast::TestXinvert<double2>, double2, double2>(argc, argv, true, "ZINVERT");
+ errors += clblast::RunTests<clblast::TestXinvert<half>, half, half>(argc, argv, true, "HINVERT");
+ if (errors > 0) { return 1; } else { return 0; }
+}
+
+// =================================================================================================
diff --git a/test/correctness/testblas.cpp b/test/correctness/testblas.cpp
index 5fddb37b..7c64855a 100644
--- a/test/correctness/testblas.cpp
+++ b/test/correctness/testblas.cpp
@@ -138,7 +138,10 @@ void TestBlas<T,U>::TestRegular(std::vector<Arguments<U>> &test_vector, const st
// Don't continue with CBLAS if there are incorrect parameters
if (compare_cblas_ && status2 != StatusCode::kSuccess) {
- if (verbose_) { fprintf(stdout, " -> "); std::cout << std::flush; }
+ if (verbose_) {
+ fprintf(stdout, " -> %d -> ", static_cast<int>(status2));
+ std::cout << std::flush;
+ }
TestErrorCodes(status2, status2, args);
continue;
}
diff --git a/test/correctness/tester.cpp b/test/correctness/tester.cpp
index efe49811..c0ed5ba4 100644
--- a/test/correctness/tester.cpp
+++ b/test/correctness/tester.cpp
@@ -426,6 +426,10 @@ bool TestSimilarityNear(const T val1, const T val2,
if (val1 == val2) {
return true;
}
+ // Handles cases with both results NaN
+ else if (std::isnan(val1) && std::isnan(val2)) {
+ return true;
+ }
// The values are zero or very small: the relative error is less meaningful
else if (val1 == 0 || val2 == 0 || difference < error_margin_absolute) {
return (difference < error_margin_absolute);