summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2015-06-17 07:15:30 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2015-06-17 07:15:30 +0200
commitaf40b8e667b6e369c633247e584baa9c13e86f98 (patch)
tree19bc5b3d92799978498928d24c7dc607ea4d3dee /test
parent9e2fba9ab9cab1f94dfe143fc6e163f47b6d6f39 (diff)
parent8b2dbdba986f24f9417eb41652f2123f38a64084 (diff)
Merge pull request #3 from CNugteren/conjugate_transpose
Added complex conjugate transpose
Diffstat (limited to 'test')
-rw-r--r--test/correctness/routines/xgemm.cc10
-rw-r--r--test/correctness/routines/xgemv.cc4
-rw-r--r--test/correctness/routines/xsymm.cc6
-rw-r--r--test/correctness/testabc.h2
-rw-r--r--test/correctness/testaxy.h2
-rw-r--r--test/correctness/tester.cc10
-rw-r--r--test/correctness/tester.h4
7 files changed, 28 insertions, 10 deletions
diff --git a/test/correctness/routines/xgemm.cc b/test/correctness/routines/xgemm.cc
index 04525cc5..2de17518 100644
--- a/test/correctness/routines/xgemm.cc
+++ b/test/correctness/routines/xgemm.cc
@@ -73,11 +73,11 @@ void XgemmTest(int argc, char *argv[], const bool silent, const std::string &nam
TestABC<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;
- for (auto &b_transpose: {Transpose::kNo, Transpose::kYes}) {
+ for (auto &b_transpose: tester.kTransposes) {
args.b_transpose = b_transpose;
const auto case_name = ToString(layout)+" "+ToString(a_transpose)+" "+ToString(b_transpose);
@@ -96,8 +96,8 @@ void XgemmTest(int argc, char *argv[], const bool silent, const std::string &nam
int main(int argc, char *argv[]) {
clblast::XgemmTest<float>(argc, argv, false, "SGEMM");
clblast::XgemmTest<double>(argc, argv, true, "DGEMM");
- //clblast::XgemmTest<float2>(argc, argv, true, "CGEMM");
- //clblast::XgemmTest<double2>(argc, argv, true, "ZGEMM");
+ clblast::XgemmTest<clblast::float2>(argc, argv, true, "CGEMM");
+ clblast::XgemmTest<clblast::double2>(argc, argv, true, "ZGEMM");
return 0;
}
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/routines/xsymm.cc b/test/correctness/routines/xsymm.cc
index 9bcad253..14d6a3f7 100644
--- a/test/correctness/routines/xsymm.cc
+++ b/test/correctness/routines/xsymm.cc
@@ -73,7 +73,7 @@ void XsymmTest(int argc, char *argv[], const bool silent, const std::string &nam
TestABC<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 &side: {Side::kLeft, Side::kRight}) {
args.side = side;
@@ -96,8 +96,8 @@ void XsymmTest(int argc, char *argv[], const bool silent, const std::string &nam
int main(int argc, char *argv[]) {
clblast::XsymmTest<float>(argc, argv, false, "SSYMM");
clblast::XsymmTest<double>(argc, argv, true, "DSYMM");
- //clblast::XsymmTest<float2>(argc, argv, true, "CSYMM");
- //clblast::XsymmTest<double2>(argc, argv, true, "ZSYMM");
+ clblast::XsymmTest<clblast::float2>(argc, argv, true, "CSYMM");
+ clblast::XsymmTest<clblast::double2>(argc, argv, true, "ZSYMM");
return 0;
}
diff --git a/test/correctness/testabc.h b/test/correctness/testabc.h
index c80f8d58..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;
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;