mirror of
https://github.com/CNugteren/CLBlast.git
synced 2024-08-21 04:22:27 +02:00
Fixed compilation issues of the testers for Visual Studio 2013: mostly conversions of class constants to static
This commit is contained in:
parent
53deed298f
commit
d0b8ca9fba
|
@ -19,7 +19,24 @@
|
||||||
namespace clblast {
|
namespace clblast {
|
||||||
// =================================================================================================
|
// =================================================================================================
|
||||||
|
|
||||||
// The transpose-options to test with (data-type dependent)
|
// 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, 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, 512 };
|
||||||
|
template <typename T, typename U> const std::vector<size_t> TestBlas<T,U>::kBandSizes = { 4, 19 };
|
||||||
|
|
||||||
|
// 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<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<float,float>::kTransposes = {Transpose::kNo, Transpose::kYes};
|
||||||
template <> const std::vector<Transpose> TestBlas<double,double>::kTransposes = {Transpose::kNo, Transpose::kYes};
|
template <> const std::vector<Transpose> TestBlas<double,double>::kTransposes = {Transpose::kNo, Transpose::kYes};
|
||||||
|
@ -39,6 +56,9 @@ TestBlas<T,U>::TestBlas(int argc, char *argv[], const bool silent,
|
||||||
const ResultGet get_result, const ResultIndex get_index,
|
const ResultGet get_result, const ResultIndex get_index,
|
||||||
const ResultIterator get_id1, const ResultIterator get_id2):
|
const ResultIterator get_id1, const ResultIterator get_id2):
|
||||||
Tester<T,U>(argc, argv, silent, name, options),
|
Tester<T,U>(argc, argv, silent, name, options),
|
||||||
|
kOffsets(GetOffsets()),
|
||||||
|
kAlphaValues(GetExampleScalars<U>(full_test_)),
|
||||||
|
kBetaValues(GetExampleScalars<U>(full_test_)),
|
||||||
run_routine_(run_routine),
|
run_routine_(run_routine),
|
||||||
get_result_(get_result),
|
get_result_(get_result),
|
||||||
get_index_(get_index),
|
get_index_(get_index),
|
||||||
|
|
|
@ -51,26 +51,26 @@ class TestBlas: public Tester<T,U> {
|
||||||
using Tester<T,U>::GetSizesString;
|
using Tester<T,U>::GetSizesString;
|
||||||
|
|
||||||
// Test settings for the regular test. Append to these lists in case more tests are required.
|
// Test settings for the regular test. Append to these lists in case more tests are required.
|
||||||
const std::vector<size_t> kVectorDims = { 7, 93, 4096 };
|
static const std::vector<size_t> kVectorDims;
|
||||||
const std::vector<size_t> kIncrements = { 1, 2, 7 };
|
static const std::vector<size_t> kIncrements;
|
||||||
const std::vector<size_t> kMatrixDims = { 7, 64 };
|
static const std::vector<size_t> kMatrixDims;
|
||||||
const std::vector<size_t> kMatrixVectorDims = { 61, 512 };
|
static const std::vector<size_t> kMatrixVectorDims;
|
||||||
const std::vector<size_t> kBandSizes = { 4, 19 };
|
static const std::vector<size_t> kBandSizes;
|
||||||
const std::vector<size_t> kOffsets = GetOffsets();
|
const std::vector<size_t> kOffsets;
|
||||||
const std::vector<U> kAlphaValues = GetExampleScalars<U>(full_test_);
|
const std::vector<U> kAlphaValues;
|
||||||
const std::vector<U> kBetaValues = GetExampleScalars<U>(full_test_);
|
const std::vector<U> kBetaValues;
|
||||||
|
|
||||||
// Test settings for the invalid tests
|
// Test settings for the invalid tests
|
||||||
const std::vector<size_t> kInvalidIncrements = { 0, 1 };
|
static const std::vector<size_t> kInvalidIncrements;
|
||||||
const size_t kBufferSize = 64;
|
static const size_t kBufferSize;
|
||||||
const std::vector<size_t> kMatSizes = {0, kBufferSize*kBufferSize-1, kBufferSize*kBufferSize};
|
static const std::vector<size_t> kMatSizes;
|
||||||
const std::vector<size_t> kVecSizes = {0, kBufferSize - 1, kBufferSize};
|
static const std::vector<size_t> kVecSizes;
|
||||||
|
|
||||||
// The layout/transpose/triangle options to test with
|
// The layout/transpose/triangle options to test with
|
||||||
const std::vector<Layout> kLayouts = {Layout::kRowMajor, Layout::kColMajor};
|
static const std::vector<Layout> kLayouts;
|
||||||
const std::vector<Triangle> kTriangles = {Triangle::kUpper, Triangle::kLower};
|
static const std::vector<Triangle> kTriangles;
|
||||||
const std::vector<Side> kSides = {Side::kLeft, Side::kRight};
|
static const std::vector<Side> kSides;
|
||||||
const std::vector<Diagonal> kDiagonals = {Diagonal::kUnit, Diagonal::kNonUnit};
|
static const std::vector<Diagonal> kDiagonals;
|
||||||
static const std::vector<Transpose> kTransposes; // Data-type dependent, see .cc-file
|
static const std::vector<Transpose> kTransposes; // Data-type dependent, see .cc-file
|
||||||
|
|
||||||
// Shorthand for the routine-specific functions passed to the tester
|
// Shorthand for the routine-specific functions passed to the tester
|
||||||
|
|
|
@ -22,6 +22,30 @@
|
||||||
namespace clblast {
|
namespace clblast {
|
||||||
// =================================================================================================
|
// =================================================================================================
|
||||||
|
|
||||||
|
// Maximum number of test results printed on a single line
|
||||||
|
template <typename T, typename U> const size_t Tester<T,U>::kResultsPerLine = size_t{64};
|
||||||
|
|
||||||
|
// Error percentage is not applicable: error was caused by an incorrect status
|
||||||
|
template <typename T, typename U> const float Tester<T,U>::kStatusError = -1.0f;
|
||||||
|
|
||||||
|
// Constants holding start and end strings for terminal-output in colour
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kPrintError = "\x1b[31m";
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kPrintSuccess = "\x1b[32m";
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kPrintWarning = "\x1b[35m";
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kPrintMessage = "\x1b[1m";
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kPrintEnd = "\x1b[0m";
|
||||||
|
|
||||||
|
// Sets the output error coding
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kSuccessData = kPrintSuccess + ":" + kPrintEnd;
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kSuccessStatus = kPrintSuccess + "." + kPrintEnd;
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kErrorData = kPrintError + "X" + kPrintEnd;
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kErrorStatus = kPrintError + "/" + kPrintEnd;
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kSkippedCompilation = kPrintWarning + "\\" + kPrintEnd;
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kUnsupportedPrecision = kPrintWarning + "o" + kPrintEnd;
|
||||||
|
template <typename T, typename U> const std::string Tester<T,U>::kUnsupportedReference = kPrintWarning + "-" + kPrintEnd;
|
||||||
|
|
||||||
|
// =================================================================================================
|
||||||
|
|
||||||
// General constructor for all CLBlast testers. It prints out the test header to stdout and sets-up
|
// General constructor for all CLBlast testers. It prints out the test header to stdout and sets-up
|
||||||
// the clBLAS library for reference.
|
// the clBLAS library for reference.
|
||||||
template <typename T, typename U>
|
template <typename T, typename U>
|
||||||
|
@ -41,8 +65,8 @@ Tester<T,U>::Tester(int argc, char *argv[], const bool silent,
|
||||||
print_count_{0},
|
print_count_{0},
|
||||||
tests_passed_{0},
|
tests_passed_{0},
|
||||||
tests_skipped_{0},
|
tests_skipped_{0},
|
||||||
tests_failed_{0},
|
tests_failed_{0} {
|
||||||
options_{options} {
|
options_ = options;
|
||||||
|
|
||||||
// Determines which reference to test against
|
// Determines which reference to test against
|
||||||
#if defined(CLBLAST_REF_CLBLAS) && defined(CLBLAST_REF_CBLAS)
|
#if defined(CLBLAST_REF_CLBLAS) && defined(CLBLAST_REF_CBLAS)
|
||||||
|
|
|
@ -39,26 +39,26 @@ class Tester {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Maximum number of test results printed on a single line
|
// Maximum number of test results printed on a single line
|
||||||
static constexpr auto kResultsPerLine = size_t{64};
|
static const size_t kResultsPerLine;
|
||||||
|
|
||||||
// Error percentage is not applicable: error was caused by an incorrect status
|
// Error percentage is not applicable: error was caused by an incorrect status
|
||||||
static constexpr auto kStatusError = -1.0f;
|
static const float kStatusError;
|
||||||
|
|
||||||
// Constants holding start and end strings for terminal-output in colour
|
// Constants holding start and end strings for terminal-output in colour
|
||||||
const std::string kPrintError{"\x1b[31m"};
|
static const std::string kPrintError;
|
||||||
const std::string kPrintSuccess{"\x1b[32m"};
|
static const std::string kPrintSuccess;
|
||||||
const std::string kPrintWarning{"\x1b[35m"};
|
static const std::string kPrintWarning;
|
||||||
const std::string kPrintMessage{"\x1b[1m"};
|
static const std::string kPrintMessage;
|
||||||
const std::string kPrintEnd{"\x1b[0m"};
|
static const std::string kPrintEnd;
|
||||||
|
|
||||||
// Sets the output error coding
|
// Sets the output error coding
|
||||||
const std::string kSuccessData{kPrintSuccess + ":" + kPrintEnd};
|
static const std::string kSuccessData;
|
||||||
const std::string kSuccessStatus{kPrintSuccess + "." + kPrintEnd};
|
static const std::string kSuccessStatus;
|
||||||
const std::string kErrorData{kPrintError + "X" + kPrintEnd};
|
static const std::string kErrorData;
|
||||||
const std::string kErrorStatus{kPrintError + "/" + kPrintEnd};
|
static const std::string kErrorStatus;
|
||||||
const std::string kSkippedCompilation{kPrintWarning + "\\" + kPrintEnd};
|
static const std::string kSkippedCompilation;
|
||||||
const std::string kUnsupportedPrecision{kPrintWarning + "o" + kPrintEnd};
|
static const std::string kUnsupportedPrecision;
|
||||||
const std::string kUnsupportedReference{kPrintWarning + "-" + kPrintEnd};
|
static const std::string kUnsupportedReference;
|
||||||
|
|
||||||
// This structure combines the above log-entry with a status code an error percentage
|
// This structure combines the above log-entry with a status code an error percentage
|
||||||
struct ErrorLogEntry {
|
struct ErrorLogEntry {
|
||||||
|
|
Loading…
Reference in a new issue