diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-02 18:06:15 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-02 18:06:15 +0200 |
commit | b24d36474334a74c286ffddc6af8fb74a3bae445 (patch) | |
tree | 1e477258db0b18a0f8a416f70814331d50f78aa7 /test/correctness | |
parent | c5461d77e58baf4776bed136bf8c682decf8134e (diff) |
Layed the groundwork for cuBLAS comparisons in the clients
Diffstat (limited to 'test/correctness')
-rw-r--r-- | test/correctness/tester.cpp | 38 | ||||
-rw-r--r-- | test/correctness/tester.hpp | 1 |
2 files changed, 27 insertions, 12 deletions
diff --git a/test/correctness/tester.cpp b/test/correctness/tester.cpp index 40784fdb..b352c1aa 100644 --- a/test/correctness/tester.cpp +++ b/test/correctness/tester.cpp @@ -116,24 +116,38 @@ Tester<T,U>::Tester(const std::vector<std::string> &arguments, const bool silent tests_failed_{0} { options_ = options; + // Determines which reference is the default + auto default_clblas = 0; + auto default_cblas = 0; + auto default_cublas = 0; + #if defined(CLBLAST_REF_CBLAS) + default_cblas = 1; + #elif defined(CLBLAST_REF_CLBLAS) + default_clblas = 1; + #elif defined(CLBLAST_REF_CUBLAS) + default_cublas = 1; + #endif + // Determines which reference to test against - #if defined(CLBLAST_REF_CLBLAS) && defined(CLBLAST_REF_CBLAS) - compare_clblas_ = GetArgument(arguments, help_, kArgCompareclblas, 0); - compare_cblas_ = GetArgument(arguments, help_, kArgComparecblas, 1); - #elif CLBLAST_REF_CLBLAS - compare_clblas_ = GetArgument(arguments, help_, kArgCompareclblas, 1); - compare_cblas_ = 0; - #elif CLBLAST_REF_CBLAS - compare_clblas_ = 0; - compare_cblas_ = GetArgument(arguments, help_, kArgComparecblas, 1); - #else - compare_clblas_ = 0; - compare_cblas_ = 0; + compare_clblas_ = 0; + compare_cblas_ = 0; + compare_cublas_ = 0; + #if defined(CLBLAST_REF_CBLAS) + compare_cblas_ = GetArgument(arguments, help_, kArgComparecblas, default_cblas); + #endif + #if defined(CLBLAST_REF_CLBLAS) + compare_clblas_ = GetArgument(arguments, help_, kArgCompareclblas, default_clblas); + #endif + #if defined(CLBLAST_REF_CUBLAS) + compare_cublas_ = GetArgument(arguments, help_, kArgComparecublas, default_cublas); #endif // Prints the help message (command-line arguments) if (!silent) { fprintf(stdout, "\n* %s\n", help_.c_str()); } + // Support for cuBLAS not available yet + if (compare_cublas_) { throw std::runtime_error("Cannot test against cuBLAS; not implemented yet"); } + // Can only test against a single reference (not two, not zero) if (compare_clblas_ && compare_cblas_) { throw std::runtime_error("Cannot test against both clBLAS and CBLAS references; choose one using the -cblas and -clblas arguments"); diff --git a/test/correctness/tester.hpp b/test/correctness/tester.hpp index f60be04b..8cfa702f 100644 --- a/test/correctness/tester.hpp +++ b/test/correctness/tester.hpp @@ -113,6 +113,7 @@ class Tester { // Testing against reference implementations int compare_cblas_; int compare_clblas_; + int compare_cublas_; private: |