summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2015-06-16 08:07:26 +0200
committerCNugteren <web@cedricnugteren.nl>2015-06-16 08:07:26 +0200
commitd7a0d970e088c85252740c1be591204bd6407cde (patch)
tree453212e9bbf3230a5248136c84c450f94fe3f52b /test
parentaf78a04eca3f4d8772130a6b14ff0f397adac9f3 (diff)
Moved layout and transpose types to generic tester and AXY routines
Diffstat (limited to 'test')
-rw-r--r--test/correctness/routines/xgemv.cc4
-rw-r--r--test/correctness/testabc.cc10
-rw-r--r--test/correctness/testabc.h6
-rw-r--r--test/correctness/testaxy.h2
-rw-r--r--test/correctness/tester.cc10
-rw-r--r--test/correctness/tester.h4
6 files changed, 20 insertions, 16 deletions
diff --git a/test/correctness/routines/xgemv.cc b/test/correctness/routines/xgemv.cc
index 5a8c6b27..69faeb64 100644
--- a/test/correctness/routines/xgemv.cc
+++ b/test/correctness/routines/xgemv.cc
@@ -66,9 +66,9 @@ void XgemvTest(int argc, char *argv[], const bool silent, const std::string &nam
TestAXY<T> tester{platform_id, device_id, name, options, clblast_lambda, clblas_lambda};
// Loops over the test-cases from a data-layout point of view
- for (auto &layout: {Layout::kRowMajor, Layout::kColMajor}) {
+ for (auto &layout: tester.kLayouts) {
args.layout = layout;
- for (auto &a_transpose: {Transpose::kNo, Transpose::kYes}) {
+ for (auto &a_transpose: tester.kTransposes) {
args.a_transpose = a_transpose;
const auto case_name = ToString(layout)+" "+ToString(a_transpose);
diff --git a/test/correctness/testabc.cc b/test/correctness/testabc.cc
index 9bc7bc79..f2880f50 100644
--- a/test/correctness/testabc.cc
+++ b/test/correctness/testabc.cc
@@ -18,16 +18,6 @@
namespace clblast {
// =================================================================================================
-// The layouts and transpose-options to test with
-template <typename T>
-const std::vector<Layout> TestABC<T>::kLayouts = {Layout::kRowMajor, Layout::kColMajor};
-template <> const std::vector<Transpose> TestABC<float>::kTransposes = {Transpose::kNo, Transpose::kYes};
-template <> const std::vector<Transpose> TestABC<double>::kTransposes = {Transpose::kNo, Transpose::kYes};
-template <> const std::vector<Transpose> TestABC<float2>::kTransposes = {Transpose::kNo, Transpose::kYes, Transpose::kConjugate};
-template <> const std::vector<Transpose> TestABC<double2>::kTransposes = {Transpose::kNo, Transpose::kYes, Transpose::kConjugate};
-
-// =================================================================================================
-
// Constructor, initializes the base class tester and input data
template <typename T>
TestABC<T>::TestABC(const size_t platform_id, const size_t device_id,
diff --git a/test/correctness/testabc.h b/test/correctness/testabc.h
index bee40357..f1e9e7f0 100644
--- a/test/correctness/testabc.h
+++ b/test/correctness/testabc.h
@@ -32,6 +32,8 @@ class TestABC: public Tester<T> {
using Tester<T>::context_;
using Tester<T>::queue_;
using Tester<T>::kErrorMargin;
+ using Tester<T>::kLayouts;
+ using Tester<T>::kTransposes;
// Uses several helper functions from the Tester class
using Tester<T>::TestStart;
@@ -50,10 +52,6 @@ class TestABC: public Tester<T> {
// Test settings for the invalid test
const size_t kBufferSize = 64;
- // The layouts and transpose-options to test with
- static const std::vector<Layout> kLayouts;
- static const std::vector<Transpose> kTransposes;
-
// Shorthand for a BLAS routine
using Routine = std::function<StatusCode(const Arguments<T>&,
const Buffer&, const Buffer&, const Buffer&,
diff --git a/test/correctness/testaxy.h b/test/correctness/testaxy.h
index 0b904172..927477ed 100644
--- a/test/correctness/testaxy.h
+++ b/test/correctness/testaxy.h
@@ -32,6 +32,8 @@ class TestAXY: public Tester<T> {
using Tester<T>::context_;
using Tester<T>::queue_;
using Tester<T>::kErrorMargin;
+ using Tester<T>::kLayouts;
+ using Tester<T>::kTransposes;
// Uses several helper functions from the Tester class
using Tester<T>::TestStart;
diff --git a/test/correctness/tester.cc b/test/correctness/tester.cc
index da1cb152..f55af842 100644
--- a/test/correctness/tester.cc
+++ b/test/correctness/tester.cc
@@ -22,6 +22,16 @@
namespace clblast {
// =================================================================================================
+// The layouts and transpose-options to test with (data-type dependent)
+template <typename T>
+const std::vector<Layout> Tester<T>::kLayouts = {Layout::kRowMajor, Layout::kColMajor};
+template <> const std::vector<Transpose> Tester<float>::kTransposes = {Transpose::kNo, Transpose::kYes};
+template <> const std::vector<Transpose> Tester<double>::kTransposes = {Transpose::kNo, Transpose::kYes};
+template <> const std::vector<Transpose> Tester<float2>::kTransposes = {Transpose::kNo, Transpose::kYes, Transpose::kConjugate};
+template <> const std::vector<Transpose> Tester<double2>::kTransposes = {Transpose::kNo, Transpose::kYes, Transpose::kConjugate};
+
+// =================================================================================================
+
// General constructor for all CLBlast testers. It prints out the test header to stdout and sets-up
// the clBLAS library for reference.
template <typename T>
diff --git a/test/correctness/tester.h b/test/correctness/tester.h
index 12f6125a..934141d2 100644
--- a/test/correctness/tester.h
+++ b/test/correctness/tester.h
@@ -61,6 +61,10 @@ class Tester {
const std::string kSkippedCompilation{kPrintWarning + "\\" + kPrintEnd};
const std::string kUnsupportedPrecision{kPrintWarning + "o" + kPrintEnd};
+ // The layouts and transpose-options to test with
+ static const std::vector<Layout> kLayouts;
+ static const std::vector<Transpose> kTransposes;
+
// This structure combines the above log-entry with a status code an error percentage
struct ErrorLogEntry {
StatusCode status_expect;