mirror of
https://github.com/CNugteren/CLBlast.git
synced 2024-08-20 20:12:26 +02:00
Made the tests for invalid buffer sizes also verbose in verbose mode
This commit is contained in:
parent
e561e3fbd5
commit
c1895ea459
|
@ -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);
|
||||
|
|
|
@ -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 };
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_;
|
||||
|
|
Loading…
Reference in a new issue