diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-06-25 20:59:22 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-06-25 20:59:22 +0200 |
commit | 19504ed60973bcdb920ec3e8c3004c2c7ca98e93 (patch) | |
tree | 52e0028e9d05991f573a292eeec55cadec1ca43b /test/correctness | |
parent | b8df03e5bcccd3b8c0eee39d2784f16f7f973433 (diff) |
Moved static variable declarations from .cpp to .hpp to resolve some Clang warnings
Diffstat (limited to 'test/correctness')
-rw-r--r-- | test/correctness/testblas.cpp | 27 | ||||
-rw-r--r-- | test/correctness/testblas.hpp | 29 |
2 files changed, 30 insertions, 26 deletions
diff --git a/test/correctness/testblas.cpp b/test/correctness/testblas.cpp index 7bc9c869..1c8aab33 100644 --- a/test/correctness/testblas.cpp +++ b/test/correctness/testblas.cpp @@ -21,37 +21,12 @@ namespace clblast { // ================================================================================================= -template <typename T, typename U> const int TestBlas<T,U>::kSeed = 42; // fixed seed for reproducibility - -// Test settings for the regular test. Append to these lists in case more tests are required. -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kVectorDims = { 7, 93, 144, 4096 }; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kIncrements = { 1, 2, 7 }; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kMatrixDims = { 7, 64 }; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kMatrixVectorDims = { 61, 256 }; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kBandSizes = { 4, 19 }; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kBatchCounts = { 1, 3 }; - -// Test settings for the invalid tests -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kInvalidIncrements = { 0, 1 }; -template <typename T, typename U> const size_t TestBlas<T,U>::kBufferSize = 64; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kMatSizes = {0, kBufferSize*kBufferSize-1, kBufferSize*kBufferSize}; -template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kVecSizes = {0, kBufferSize - 1, kBufferSize}; - -// The layout/transpose/triangle options to test with -template <typename T, typename U> const std::vector<Layout> TestBlas<T,U>::kLayouts = {Layout::kRowMajor, Layout::kColMajor}; -template <typename T, typename U> const std::vector<Triangle> TestBlas<T,U>::kTriangles = {Triangle::kUpper, Triangle::kLower}; -template <typename T, typename U> const std::vector<Side> TestBlas<T,U>::kSides = {Side::kLeft, Side::kRight}; -template <typename T, typename U> const std::vector<Diagonal> TestBlas<T,U>::kDiagonals = {Diagonal::kUnit, Diagonal::kNonUnit}; -template <> const std::vector<Transpose> TestBlas<half,half>::kTransposes = {Transpose::kNo, Transpose::kYes}; -template <> const std::vector<Transpose> TestBlas<float,float>::kTransposes = {Transpose::kNo, Transpose::kYes}; -template <> const std::vector<Transpose> TestBlas<double,double>::kTransposes = {Transpose::kNo, Transpose::kYes}; +// The transpose configurations to test with: cases other than No/Yes template <> const std::vector<Transpose> TestBlas<float2,float2>::kTransposes = {Transpose::kNo, Transpose::kYes, Transpose::kConjugate}; template <> const std::vector<Transpose> TestBlas<double2,double2>::kTransposes = {Transpose::kNo, Transpose::kYes, Transpose::kConjugate}; template <> const std::vector<Transpose> TestBlas<float2,float>::kTransposes = {Transpose::kNo, Transpose::kConjugate}; template <> const std::vector<Transpose> TestBlas<double2,double>::kTransposes = {Transpose::kNo, Transpose::kConjugate}; -// ================================================================================================= - // Constructor, initializes the base class tester and input data template <typename T, typename U> TestBlas<T,U>::TestBlas(const std::vector<std::string> &arguments, const bool silent, diff --git a/test/correctness/testblas.hpp b/test/correctness/testblas.hpp index 560ff4d3..efa60ab2 100644 --- a/test/correctness/testblas.hpp +++ b/test/correctness/testblas.hpp @@ -121,6 +121,35 @@ class TestBlas: public Tester<T,U> { // ================================================================================================= +template <typename T, typename U> const int TestBlas<T,U>::kSeed = 42; // fixed seed for reproducibility + +// Test settings for the regular test. Append to these lists in case more tests are required. +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kVectorDims = { 7, 93, 144, 4096 }; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kIncrements = { 1, 2, 7 }; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kMatrixDims = { 7, 64 }; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kMatrixVectorDims = { 61, 256 }; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kBandSizes = { 4, 19 }; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kBatchCounts = { 1, 3 }; + +// Test settings for the invalid tests +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kInvalidIncrements = { 0, 1 }; +template <typename T, typename U> const size_t TestBlas<T,U>::kBufferSize = 64; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kMatSizes = {0, kBufferSize*kBufferSize-1, kBufferSize*kBufferSize}; +template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kVecSizes = {0, kBufferSize - 1, kBufferSize}; + +// The layout/transpose/triangle options to test with +template <typename T, typename U> const std::vector<Layout> TestBlas<T,U>::kLayouts = {Layout::kRowMajor, Layout::kColMajor}; +template <typename T, typename U> const std::vector<Triangle> TestBlas<T,U>::kTriangles = {Triangle::kUpper, Triangle::kLower}; +template <typename T, typename U> const std::vector<Side> TestBlas<T,U>::kSides = {Side::kLeft, Side::kRight}; +template <typename T, typename U> const std::vector<Diagonal> TestBlas<T,U>::kDiagonals = {Diagonal::kUnit, Diagonal::kNonUnit}; +template <typename T, typename U> const std::vector<Transpose> TestBlas<T,U>::kTransposes = {Transpose::kNo, Transpose::kYes}; +template <> const std::vector<Transpose> TestBlas<float2,float2>::kTransposes; // see testblas.cpp +template <> const std::vector<Transpose> TestBlas<double2,double2>::kTransposes; // see testblas.cpp +template <> const std::vector<Transpose> TestBlas<float2,float>::kTransposes; // see testblas.cpp +template <> const std::vector<Transpose> TestBlas<double2,double>::kTransposes; // see testblas.cpp + +// ================================================================================================= + // Bogus reference function, in case a comparison library is not available template <typename T, typename U, typename BufferType> static StatusCode ReferenceNotAvailable(const Arguments<U> &, BufferType &, Queue &) { |