diff options
author | CNugteren <web@cedricnugteren.nl> | 2015-06-20 13:33:50 +0200 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2015-06-20 13:33:50 +0200 |
commit | 3ea3ba2beeab837e8d7c533746bd621daf1c09bd (patch) | |
tree | 8bce01e529f1ddca6a8af45b89a51f0e7f0935e6 /test | |
parent | dfbc3365312a8ee1c100d7659e5814548192b48d (diff) |
Distinguish between a short smoke test and a full test
Diffstat (limited to 'test')
-rw-r--r-- | test/correctness/testabc.h | 3 | ||||
-rw-r--r-- | test/correctness/testaxy.h | 3 | ||||
-rw-r--r-- | test/correctness/tester.cc | 20 | ||||
-rw-r--r-- | test/correctness/tester.h | 7 | ||||
-rw-r--r-- | test/correctness/testxy.h | 3 |
5 files changed, 28 insertions, 8 deletions
diff --git a/test/correctness/testabc.h b/test/correctness/testabc.h index 6472af42..b7601024 100644 --- a/test/correctness/testabc.h +++ b/test/correctness/testabc.h @@ -41,10 +41,11 @@ class TestABC: public Tester<T> { using Tester<T>::TestErrorCount; using Tester<T>::TestErrorCodes; using Tester<T>::GetExampleScalars; + using Tester<T>::GetOffsets; // Test settings for the regular test. Append to this list in case more tests are required. const std::vector<size_t> kMatrixDims = { 7, 64 }; - const std::vector<size_t> kOffsets = { 0 }; + const std::vector<size_t> kOffsets = GetOffsets(); const std::vector<T> kAlphaValues = GetExampleScalars(); const std::vector<T> kBetaValues = GetExampleScalars(); diff --git a/test/correctness/testaxy.h b/test/correctness/testaxy.h index 9135e2ba..00d4f6ec 100644 --- a/test/correctness/testaxy.h +++ b/test/correctness/testaxy.h @@ -41,10 +41,11 @@ class TestAXY: public Tester<T> { using Tester<T>::TestErrorCount; using Tester<T>::TestErrorCodes; using Tester<T>::GetExampleScalars; + using Tester<T>::GetOffsets; // Test settings for the regular test. Append to this list in case more tests are required. const std::vector<size_t> kMatrixVectorDims = { 61, 512 }; - const std::vector<size_t> kOffsets = { 0, 10 }; + const std::vector<size_t> kOffsets = GetOffsets(); const std::vector<size_t> kIncrements = { 1, 2 }; const std::vector<T> kAlphaValues = GetExampleScalars(); const std::vector<T> kBetaValues = GetExampleScalars(); diff --git a/test/correctness/tester.cc b/test/correctness/tester.cc index e6285f32..09b0b5bd 100644 --- a/test/correctness/tester.cc +++ b/test/correctness/tester.cc @@ -41,6 +41,7 @@ Tester<T>::Tester(int argc, char *argv[], const bool silent, device_(Device(platform_, kDeviceType, GetArgument(argc, argv, help_, kArgDevice, size_t{0}))), context_(Context(device_)), queue_(CommandQueue(context_, device_)), + full_test_(CheckArgument(argc, argv, help_, kArgFullTest)), error_log_{}, num_passed_{0}, num_skipped_{0}, @@ -261,19 +262,30 @@ void Tester<T>::TestErrorCodes(const StatusCode clblas_status, const StatusCode // routines. This function is specialised for the different data-types. template <> const std::vector<float> Tester<float>::GetExampleScalars() { - return {0.0f, 1.0f, 3.14f}; + if (full_test_) { return {0.0f, 1.0f, 3.14f}; } + else { return {3.14f}; } } template <> const std::vector<double> Tester<double>::GetExampleScalars() { - return {0.0, 1.0, 3.14}; + if (full_test_) { return {0.0, 1.0, 3.14}; } + else { return {3.14}; } } template <> const std::vector<float2> Tester<float2>::GetExampleScalars() { - return {{0.0f, 0.0f}, {1.0f, 1.3f}, {2.42f, 3.14f}}; + if (full_test_) { return {{0.0f, 0.0f}, {1.0f, 1.3f}, {2.42f, 3.14f}}; } + else { return {{2.42f, 3.14f}}; } } template <> const std::vector<double2> Tester<double2>::GetExampleScalars() { - return {{0.0, 0.0}, {1.0, 1.3}, {2.42, 3.14}}; + if (full_test_) { return {{0.0, 0.0}, {1.0, 1.3}, {2.42, 3.14}}; } + else { return {{2.42, 3.14}}; } +} + +// Retrieves the offset values to test with +template <typename T> +const std::vector<size_t> Tester<T>::GetOffsets() { + if (full_test_) { return {0, 10}; } + else { return {0}; } } // ================================================================================================= diff --git a/test/correctness/tester.h b/test/correctness/tester.h index ffc02bbf..1085c472 100644 --- a/test/correctness/tester.h +++ b/test/correctness/tester.h @@ -97,6 +97,9 @@ class Tester { // Retrieves a list of example scalars of the right type const std::vector<T> GetExampleScalars(); + // Retrieves a list of offset values to test + const std::vector<size_t> GetOffsets(); + // The help-message std::string help_; @@ -108,7 +111,6 @@ class Tester { private: - // Internal methods to report a passed, skipped, or failed test void ReportPass(); void ReportSkipped(); @@ -117,6 +119,9 @@ class Tester { // Prints the error or success symbol to screen void PrintTestResult(const std::string &message); + // Whether or not to run the full test-suite or just a smoke test + bool full_test_; + // Logging and counting occurrences of errors std::vector<ErrorLogEntry> error_log_; size_t num_passed_; diff --git a/test/correctness/testxy.h b/test/correctness/testxy.h index c806de14..8f2b6876 100644 --- a/test/correctness/testxy.h +++ b/test/correctness/testxy.h @@ -39,10 +39,11 @@ class TestXY: public Tester<T> { using Tester<T>::TestErrorCount; using Tester<T>::TestErrorCodes; using Tester<T>::GetExampleScalars; + using Tester<T>::GetOffsets; // Test settings for the regular test. Append to this list in case more tests are required. const std::vector<size_t> kVectorDims = { 7, 93, 4096 }; - const std::vector<size_t> kOffsets = { 0, 10 }; + const std::vector<size_t> kOffsets = GetOffsets(); const std::vector<size_t> kIncrements = { 1, 2 }; const std::vector<T> kAlphaValues = GetExampleScalars(); |