diff options
author | CNugteren <web@cedricnugteren.nl> | 2015-07-31 15:52:13 +0200 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2015-07-31 15:52:13 +0200 |
commit | c5d5adbddd9a7e1816e7666a2f287f8266ca2c19 (patch) | |
tree | e243248d73c3c46b0902c886cbe51599d8ec8c87 /test/routines | |
parent | 6e1e7fdcaf9f544c98c3f8867d0f0f60bed252dd (diff) |
Refactored the correctness tests
Diffstat (limited to 'test/routines')
-rw-r--r-- | test/routines/level1/xaxpy.h | 8 | ||||
-rw-r--r-- | test/routines/level2/xgemv.h | 18 | ||||
-rw-r--r-- | test/routines/level3/xgemm.h | 8 | ||||
-rw-r--r-- | test/routines/level3/xhemm.h | 8 | ||||
-rw-r--r-- | test/routines/level3/xher2k.h | 12 | ||||
-rw-r--r-- | test/routines/level3/xherk.h | 8 | ||||
-rw-r--r-- | test/routines/level3/xsymm.h | 8 | ||||
-rw-r--r-- | test/routines/level3/xsyr2k.h | 12 | ||||
-rw-r--r-- | test/routines/level3/xsyrk.h | 8 | ||||
-rw-r--r-- | test/routines/level3/xtrmm.h | 8 |
10 files changed, 89 insertions, 9 deletions
diff --git a/test/routines/level1/xaxpy.h b/test/routines/level1/xaxpy.h index 866fb620..50480f46 100644 --- a/test/routines/level1/xaxpy.h +++ b/test/routines/level1/xaxpy.h @@ -29,6 +29,9 @@ template <typename T> class TestXaxpy { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 1; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgN, @@ -56,6 +59,11 @@ class TestXaxpy { static size_t DefaultLDB(const Arguments<T> &) { return 1; } // N/A for this routine static size_t DefaultLDC(const Arguments<T> &) { return 1; } // N/A for this routine + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {}; } // N/A for this routine + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level2/xgemv.h b/test/routines/level2/xgemv.h index 056dec30..927bfaee 100644 --- a/test/routines/level2/xgemv.h +++ b/test/routines/level2/xgemv.h @@ -29,6 +29,9 @@ template <typename T> class TestXgemv { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 2; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgM, kArgN, @@ -39,11 +42,6 @@ class TestXgemv { } // Describes how to obtain the sizes of the buffers - static size_t GetSizeA(const Arguments<T> &args) { - auto a_rotated = (args.layout == Layout::kRowMajor); - auto a_two = (a_rotated) ? args.m : args.n; - return a_two * args.a_ld + args.a_offset; - } static size_t GetSizeX(const Arguments<T> &args) { auto a_transposed = (args.a_transpose != Transpose::kNo); auto n_real = (a_transposed) ? args.m : args.n; @@ -54,6 +52,11 @@ class TestXgemv { auto m_real = (a_transposed) ? args.n : args.m; return m_real * args.y_inc + args.y_offset; } + static size_t GetSizeA(const Arguments<T> &args) { + auto a_rotated = (args.layout == Layout::kRowMajor); + auto a_two = (a_rotated) ? args.m : args.n; + return a_two * args.a_ld + args.a_offset; + } // Describes how to set the sizes of all the buffers static void SetSizes(Arguments<T> &args) { @@ -67,6 +70,11 @@ class TestXgemv { static size_t DefaultLDB(const Arguments<T> &) { return 1; } // N/A for this routine static size_t DefaultLDC(const Arguments<T> &) { return 1; } // N/A for this routine + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &all) { return all; } + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xgemm.h b/test/routines/level3/xgemm.h index f06719d6..695b58b7 100644 --- a/test/routines/level3/xgemm.h +++ b/test/routines/level3/xgemm.h @@ -29,6 +29,9 @@ template <typename T> class TestXgemm { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgM, kArgN, kArgK, @@ -69,6 +72,11 @@ class TestXgemm { static size_t DefaultLDB(const Arguments<T> &args) { return args.n; } static size_t DefaultLDC(const Arguments<T> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &all) { return all; } + static Transposes GetBTransposes(const Transposes &all) { return all; } + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xhemm.h b/test/routines/level3/xhemm.h index 0c3b9c31..7b7134e5 100644 --- a/test/routines/level3/xhemm.h +++ b/test/routines/level3/xhemm.h @@ -29,6 +29,9 @@ template <typename T> class TestXhemm { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgM, kArgN, @@ -69,6 +72,11 @@ class TestXhemm { static size_t DefaultLDB(const Arguments<T> &args) { return args.n; } static size_t DefaultLDC(const Arguments<T> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {}; } // N/A for this routine + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xher2k.h b/test/routines/level3/xher2k.h index b20ec973..a7fbfcbe 100644 --- a/test/routines/level3/xher2k.h +++ b/test/routines/level3/xher2k.h @@ -29,6 +29,9 @@ template <typename T, typename U> class TestXher2k { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgN, kArgK, @@ -46,8 +49,8 @@ class TestXher2k { return a_two * args.a_ld + args.a_offset; } static size_t GetSizeB(const Arguments<U> &args) { - auto b_rotated = (args.layout == Layout::kColMajor && args.b_transpose != Transpose::kNo) || - (args.layout == Layout::kRowMajor && args.b_transpose == Transpose::kNo); + auto b_rotated = (args.layout == Layout::kColMajor && args.a_transpose != Transpose::kNo) || + (args.layout == Layout::kRowMajor && args.a_transpose == Transpose::kNo); auto b_two = (b_rotated) ? args.n : args.k; return b_two * args.b_ld + args.b_offset; } @@ -67,6 +70,11 @@ class TestXher2k { static size_t DefaultLDB(const Arguments<U> &args) { return args.k; } static size_t DefaultLDC(const Arguments<U> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {Transpose::kNo, Transpose::kConjugate}; } + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<U> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xherk.h b/test/routines/level3/xherk.h index 20c2b4b8..f097672f 100644 --- a/test/routines/level3/xherk.h +++ b/test/routines/level3/xherk.h @@ -29,6 +29,9 @@ template <typename T, typename U> class TestXherk { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgN, kArgK, @@ -60,6 +63,11 @@ class TestXherk { static size_t DefaultLDB(const Arguments<U> &) { return 1; } // N/A for this routine static size_t DefaultLDC(const Arguments<U> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {Transpose::kNo, Transpose::kConjugate}; } + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<U> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xsymm.h b/test/routines/level3/xsymm.h index 5b5ad351..03cf5de9 100644 --- a/test/routines/level3/xsymm.h +++ b/test/routines/level3/xsymm.h @@ -29,6 +29,9 @@ template <typename T> class TestXsymm { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgM, kArgN, @@ -69,6 +72,11 @@ class TestXsymm { static size_t DefaultLDB(const Arguments<T> &args) { return args.n; } static size_t DefaultLDC(const Arguments<T> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {}; } // N/A for this routine + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xsyr2k.h b/test/routines/level3/xsyr2k.h index 21fcee2a..89e77f83 100644 --- a/test/routines/level3/xsyr2k.h +++ b/test/routines/level3/xsyr2k.h @@ -29,6 +29,9 @@ template <typename T> class TestXsyr2k { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgN, kArgK, @@ -46,8 +49,8 @@ class TestXsyr2k { return a_two * args.a_ld + args.a_offset; } static size_t GetSizeB(const Arguments<T> &args) { - auto b_rotated = (args.layout == Layout::kColMajor && args.b_transpose != Transpose::kNo) || - (args.layout == Layout::kRowMajor && args.b_transpose == Transpose::kNo); + auto b_rotated = (args.layout == Layout::kColMajor && args.a_transpose != Transpose::kNo) || + (args.layout == Layout::kRowMajor && args.a_transpose == Transpose::kNo); auto b_two = (b_rotated) ? args.n : args.k; return b_two * args.b_ld + args.b_offset; } @@ -67,6 +70,11 @@ class TestXsyr2k { static size_t DefaultLDB(const Arguments<T> &args) { return args.k; } static size_t DefaultLDC(const Arguments<T> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {Transpose::kNo, Transpose::kYes}; } + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xsyrk.h b/test/routines/level3/xsyrk.h index c92693c2..8dacb5b3 100644 --- a/test/routines/level3/xsyrk.h +++ b/test/routines/level3/xsyrk.h @@ -29,6 +29,9 @@ template <typename T> class TestXsyrk { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgN, kArgK, @@ -60,6 +63,11 @@ class TestXsyrk { static size_t DefaultLDB(const Arguments<T> &) { return 1; } // N/A for this routine static size_t DefaultLDC(const Arguments<T> &args) { return args.n; } + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &) { return {Transpose::kNo, Transpose::kYes}; } + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); diff --git a/test/routines/level3/xtrmm.h b/test/routines/level3/xtrmm.h index d5a52903..152cdf58 100644 --- a/test/routines/level3/xtrmm.h +++ b/test/routines/level3/xtrmm.h @@ -29,6 +29,9 @@ template <typename T> class TestXtrmm { public: + // The BLAS level: 1, 2, or 3 + static size_t BLASLevel() { return 3; } + // The list of arguments relevant for this routine static std::vector<std::string> GetOptions() { return {kArgM, kArgN, @@ -60,6 +63,11 @@ class TestXtrmm { static size_t DefaultLDB(const Arguments<T> &args) { return args.n; } static size_t DefaultLDC(const Arguments<T> &) { return 1; } // N/A for this routine + // Describes which transpose options are relevant for this routine + using Transposes = std::vector<Transpose>; + static Transposes GetATransposes(const Transposes &all) { return all; } + static Transposes GetBTransposes(const Transposes &) { return {}; } // N/A for this routine + // Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, const Buffers<T> &buffers, Queue &queue) { auto queue_plain = queue(); |