diff options
-rw-r--r-- | test/correctness/testblas.cc | 5 | ||||
-rw-r--r-- | test/correctness/testblas.h | 1 | ||||
-rw-r--r-- | test/correctness/tester.cc | 22 | ||||
-rw-r--r-- | test/correctness/tester.h | 3 |
4 files changed, 29 insertions, 2 deletions
diff --git a/test/correctness/testblas.cc b/test/correctness/testblas.cc index 04bd3aa3..e5addc48 100644 --- a/test/correctness/testblas.cc +++ b/test/correctness/testblas.cc @@ -181,6 +181,11 @@ void TestBlas<T,U>::TestInvalid(std::vector<Arguments<U>> &test_vector, const st // Iterates over all the to-be-tested combinations of arguments for (auto &args: test_vector) { + // Prints the current test configuration + if (verbose_) { + fprintf(stdout, " Config: %s-> ", GetSizesString(args).c_str()); + } + // Creates the OpenCL buffers. Note: we are not using the C++ version since we explicitly // want to be able to create invalid buffers (no error checking here). auto x1 = clCreateBuffer(context_(), CL_MEM_READ_WRITE, args.x_size*sizeof(T), nullptr,nullptr); diff --git a/test/correctness/testblas.h b/test/correctness/testblas.h index f3435342..cce10751 100644 --- a/test/correctness/testblas.h +++ b/test/correctness/testblas.h @@ -47,6 +47,7 @@ class TestBlas: public Tester<T,U> { using Tester<T,U>::TestErrorCodes; using Tester<T,U>::GetOffsets; using Tester<T,U>::GetOptionsString; + 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 }; diff --git a/test/correctness/tester.cc b/test/correctness/tester.cc index c60193cb..903e70c1 100644 --- a/test/correctness/tester.cc +++ b/test/correctness/tester.cc @@ -151,7 +151,7 @@ void Tester<T,U>::TestStart(const std::string &test_name, const std::string &tes // summary of the number of sub-tests passed/failed. template <typename T, typename U> void Tester<T,U>::TestEnd() { - fprintf(stdout, "\n"); + if (!verbose_) { fprintf(stdout, "\n"); } tests_passed_ += num_passed_; tests_skipped_ += num_skipped_; tests_failed_ += num_failed_; @@ -277,6 +277,26 @@ std::string Tester<T,U>::GetOptionsString(const Arguments<U> &args) { return result; } +// As above, but now only prints information relevant to invalid buffer sizes +template <typename T, typename U> +std::string Tester<T,U>::GetSizesString(const Arguments<U> &args) { + auto result = std::string(""); + const auto equals = std::string("="); + for (auto &o: options_) { + if (o == kArgM) { result += kArgM + equals + ToString(args.m) + " "; } + if (o == kArgN) { result += kArgN + equals + ToString(args.n) + " "; } + if (o == kArgK) { result += kArgK + equals + ToString(args.k) + " "; } + if (o == kArgXOffset) { result += "xsize" + equals + ToString(args.x_size) + " "; } + if (o == kArgYOffset) { result += "ysize" + equals + ToString(args.y_size) + " "; } + if (o == kArgAOffset) { result += "asize" + equals + ToString(args.a_size) + " "; } + if (o == kArgBOffset) { result += "bsize" + equals + ToString(args.b_size) + " "; } + if (o == kArgCOffset) { result += "csize" + equals + ToString(args.c_size) + " "; } + if (o == kArgAPOffset) { result += "apsize" + equals + ToString(args.ap_size) + " "; } + if (o == kArgDotOffset){ result += "scalarsize" + equals + ToString(args.scalar_size) + " "; } + } + return result; +} + // ================================================================================================= // A test can either pass, be skipped, or fail diff --git a/test/correctness/tester.h b/test/correctness/tester.h index 5f12c990..0defacec 100644 --- a/test/correctness/tester.h +++ b/test/correctness/tester.h @@ -107,7 +107,8 @@ class Tester { const std::vector<size_t> GetOffsets() const; // Retrieves the list of options as a string - std::string GetOptionsString(const Arguments<U> &args); + std::string GetOptionsString(const Arguments<U> &args); // for regular tests + std::string GetSizesString(const Arguments<U> &args); // for invalid buffer sizes // Testing against reference implementations int compare_cblas_; |