Fixed compilation issues of the testers for Visual Studio 2013: mostly conversions of class constants to static

This commit is contained in:
Cedric Nugteren 2016-10-18 10:19:03 +02:00
parent 53deed298f
commit d0b8ca9fba
4 changed files with 77 additions and 33 deletions

View file

@ -19,7 +19,24 @@
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<float,float>::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 ResultIterator get_id1, const ResultIterator get_id2):
Tester<T,U>(argc, argv, silent, name, options),
kOffsets(GetOffsets()),
kAlphaValues(GetExampleScalars<U>(full_test_)),
kBetaValues(GetExampleScalars<U>(full_test_)),
run_routine_(run_routine),
get_result_(get_result),
get_index_(get_index),

View file

@ -51,26 +51,26 @@ class TestBlas: public Tester<T,U> {
using Tester<T,U>::GetSizesString;
// 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 };
const std::vector<size_t> kIncrements = { 1, 2, 7 };
const std::vector<size_t> kMatrixDims = { 7, 64 };
const std::vector<size_t> kMatrixVectorDims = { 61, 512 };
const std::vector<size_t> kBandSizes = { 4, 19 };
const std::vector<size_t> kOffsets = GetOffsets();
const std::vector<U> kAlphaValues = GetExampleScalars<U>(full_test_);
const std::vector<U> kBetaValues = GetExampleScalars<U>(full_test_);
static const std::vector<size_t> kVectorDims;
static const std::vector<size_t> kIncrements;
static const std::vector<size_t> kMatrixDims;
static const std::vector<size_t> kMatrixVectorDims;
static const std::vector<size_t> kBandSizes;
const std::vector<size_t> kOffsets;
const std::vector<U> kAlphaValues;
const std::vector<U> kBetaValues;
// Test settings for the invalid tests
const std::vector<size_t> kInvalidIncrements = { 0, 1 };
const size_t kBufferSize = 64;
const std::vector<size_t> kMatSizes = {0, kBufferSize*kBufferSize-1, kBufferSize*kBufferSize};
const std::vector<size_t> kVecSizes = {0, kBufferSize - 1, kBufferSize};
static const std::vector<size_t> kInvalidIncrements;
static const size_t kBufferSize;
static const std::vector<size_t> kMatSizes;
static const std::vector<size_t> kVecSizes;
// The layout/transpose/triangle options to test with
const std::vector<Layout> kLayouts = {Layout::kRowMajor, Layout::kColMajor};
const std::vector<Triangle> kTriangles = {Triangle::kUpper, Triangle::kLower};
const std::vector<Side> kSides = {Side::kLeft, Side::kRight};
const std::vector<Diagonal> kDiagonals = {Diagonal::kUnit, Diagonal::kNonUnit};
static const std::vector<Layout> kLayouts;
static const std::vector<Triangle> kTriangles;
static const std::vector<Side> kSides;
static const std::vector<Diagonal> kDiagonals;
static const std::vector<Transpose> kTransposes; // Data-type dependent, see .cc-file
// Shorthand for the routine-specific functions passed to the tester

View file

@ -22,6 +22,30 @@
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
// the clBLAS library for reference.
template <typename T, typename U>
@ -41,8 +65,8 @@ Tester<T,U>::Tester(int argc, char *argv[], const bool silent,
print_count_{0},
tests_passed_{0},
tests_skipped_{0},
tests_failed_{0},
options_{options} {
tests_failed_{0} {
options_ = options;
// Determines which reference to test against
#if defined(CLBLAST_REF_CLBLAS) && defined(CLBLAST_REF_CBLAS)

View file

@ -39,26 +39,26 @@ class Tester {
public:
// 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
static constexpr auto kStatusError = -1.0f;
static const float kStatusError;
// Constants holding start and end strings for terminal-output in colour
const std::string kPrintError{"\x1b[31m"};
const std::string kPrintSuccess{"\x1b[32m"};
const std::string kPrintWarning{"\x1b[35m"};
const std::string kPrintMessage{"\x1b[1m"};
const std::string kPrintEnd{"\x1b[0m"};
static const std::string kPrintError;
static const std::string kPrintSuccess;
static const std::string kPrintWarning;
static const std::string kPrintMessage;
static const std::string kPrintEnd;
// Sets the output error coding
const std::string kSuccessData{kPrintSuccess + ":" + kPrintEnd};
const std::string kSuccessStatus{kPrintSuccess + "." + kPrintEnd};
const std::string kErrorData{kPrintError + "X" + kPrintEnd};
const std::string kErrorStatus{kPrintError + "/" + kPrintEnd};
const std::string kSkippedCompilation{kPrintWarning + "\\" + kPrintEnd};
const std::string kUnsupportedPrecision{kPrintWarning + "o" + kPrintEnd};
const std::string kUnsupportedReference{kPrintWarning + "-" + kPrintEnd};
static const std::string kSuccessData;
static const std::string kSuccessStatus;
static const std::string kErrorData;
static const std::string kErrorStatus;
static const std::string kSkippedCompilation;
static const std::string kUnsupportedPrecision;
static const std::string kUnsupportedReference;
// This structure combines the above log-entry with a status code an error percentage
struct ErrorLogEntry {