diff options
Diffstat (limited to 'test/correctness/routines/level3/xher2k.cc')
-rw-r--r-- | test/correctness/routines/level3/xher2k.cc | 80 |
1 files changed, 5 insertions, 75 deletions
diff --git a/test/correctness/routines/level3/xher2k.cc b/test/correctness/routines/level3/xher2k.cc index ba5260fb..dd03fcd7 100644 --- a/test/correctness/routines/level3/xher2k.cc +++ b/test/correctness/routines/level3/xher2k.cc @@ -14,86 +14,16 @@ #include "correctness/testblas.h" #include "routines/level3/xher2k.h" -namespace clblast { // ================================================================================================= -// The correctness tester -template <typename T, typename U> -void RunTest(int argc, char *argv[], const bool silent, const std::string &name) { - - // Creates a tester - TestBlas<T,U> tester{argc, argv, silent, name, TestXher2k<T,U>::GetOptions(), - TestXher2k<T,U>::RunRoutine, TestXher2k<T,U>::RunReference, - TestXher2k<T,U>::DownloadResult, TestXher2k<T,U>::GetResultIndex, - TestXher2k<T,U>::ResultID1, TestXher2k<T,U>::ResultID2}; - - // This variable holds the arguments relevant for this routine - auto args = Arguments<U>{}; - - // Loops over the test-cases from a data-layout point of view - for (auto &layout: tester.kLayouts) { args.layout = layout; - for (auto &triangle: tester.kTriangles) { args.triangle = triangle; - for (auto &ab_transpose: {Transpose::kNo, Transpose::kConjugate}) { // Regular transpose not a - args.a_transpose = ab_transpose; // valid BLAS option - args.b_transpose = ab_transpose; - - // Creates the arguments vector for the regular tests - auto regular_test_vector = std::vector<Arguments<U>>{}; - for (auto &n: tester.kMatrixDims) { args.n = n; - for (auto &k: tester.kMatrixDims) { args.k = k; - for (auto &a_ld: tester.kMatrixDims) { args.a_ld = a_ld; - for (auto &a_offset: tester.kOffsets) { args.a_offset = a_offset; - for (auto &b_ld: tester.kMatrixDims) { args.b_ld = b_ld; - for (auto &b_offset: tester.kOffsets) { args.b_offset = b_offset; - for (auto &c_ld: tester.kMatrixDims) { args.c_ld = c_ld; - for (auto &c_offset: tester.kOffsets) { args.c_offset = c_offset; - for (auto &alpha: tester.kAlphaValues) { args.alpha = alpha; - for (auto &beta: tester.kBetaValues) { args.beta = beta; - args.a_size = TestXher2k<T,U>::GetSizeA(args); - args.b_size = TestXher2k<T,U>::GetSizeB(args); - args.c_size = TestXher2k<T,U>::GetSizeC(args); - if (args.a_size<1 || args.b_size<1 || args.c_size<1) { continue; } - regular_test_vector.push_back(args); - } - } - } - } - } - } - } - } - } - } - - // Creates the arguments vector for the invalid-buffer tests - auto invalid_test_vector = std::vector<Arguments<U>>{}; - args.n = args.k = tester.kBufferSize; - args.a_ld = args.b_ld = args.c_ld = tester.kBufferSize; - args.a_offset = args.b_offset = args.c_offset = 0; - for (auto &a_size: tester.kMatSizes) { args.a_size = a_size; - for (auto &b_size: tester.kMatSizes) { args.b_size = b_size; - for (auto &c_size: tester.kMatSizes) { args.c_size = c_size; - invalid_test_vector.push_back(args); - } - } - } - - // Runs the tests - const auto case_name = ToString(layout)+" "+ToString(triangle)+" "+ToString(ab_transpose); - tester.TestRegular(regular_test_vector, case_name); - tester.TestInvalid(invalid_test_vector, case_name); - } - } - } -} - -// ================================================================================================= -} // namespace clblast +// Shortcuts to the clblast namespace +using float2 = clblast::float2; +using double2 = clblast::double2; // Main function (not within the clblast namespace) int main(int argc, char *argv[]) { - clblast::RunTest<clblast::float2,float>(argc, argv, false, "CHER2K"); - clblast::RunTest<clblast::double2,double>(argc, argv, true, "ZHER2K"); + clblast::RunTests<clblast::TestXher2k<float2,float>, float2, float>(argc, argv, false, "CHER2K"); + clblast::RunTests<clblast::TestXher2k<double2,double>, double2, double>(argc, argv, true, "ZHER2K"); return 0; } |