diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-01 13:36:24 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-01 13:36:24 +0200 |
commit | b84d2296b87ac212474af855d916b12adf96bdb7 (patch) | |
tree | 0f2e85e1e1acef1d22f046499dd0b8a30e5da4f9 /test/routines/level3/xher2k.hpp | |
parent | a98c00a2671b8981579f3a73dca8fb3365a95e53 (diff) |
Separated host-device and device-host memory copies from execution of the CBLAS reference code; for fair timing and code de-duplication
Diffstat (limited to 'test/routines/level3/xher2k.hpp')
-rw-r--r-- | test/routines/level3/xher2k.hpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/test/routines/level3/xher2k.hpp b/test/routines/level3/xher2k.hpp index 5ca3aac6..ea13bbc1 100644 --- a/test/routines/level3/xher2k.hpp +++ b/test/routines/level3/xher2k.hpp @@ -45,6 +45,8 @@ class TestXher2k { kArgAOffset, kArgBOffset, kArgCOffset, kArgAlpha, kArgBeta}; } + static std::vector<std::string> BuffersIn() { return {kBufMatA, kBufMatB, kBufMatC}; } + static std::vector<std::string> BuffersOut() { return {kBufMatC}; } // Describes how to obtain the sizes of the buffers static size_t GetSizeA(const Arguments<U> &args) { @@ -121,22 +123,15 @@ class TestXher2k { // Describes how to run the CPU BLAS routine (for correctness/performance comparison) #ifdef CLBLAST_REF_CBLAS - static StatusCode RunReference2(const Arguments<U> &args, Buffers<T> &buffers, Queue &queue) { - std::vector<T> a_mat_cpu(args.a_size, static_cast<T>(0)); - std::vector<T> b_mat_cpu(args.b_size, static_cast<T>(0)); - std::vector<T> c_mat_cpu(args.c_size, static_cast<T>(0)); - buffers.a_mat.Read(queue, args.a_size, a_mat_cpu); - buffers.b_mat.Read(queue, args.b_size, b_mat_cpu); - buffers.c_mat.Read(queue, args.c_size, c_mat_cpu); + static StatusCode RunReference2(const Arguments<U> &args, BuffersHost<T> &buffers_host, Queue&) { auto alpha2 = T{args.alpha, args.alpha}; cblasXher2k(convertToCBLAS(args.layout), convertToCBLAS(args.triangle), convertToCBLAS(args.a_transpose), args.n, args.k, alpha2, - a_mat_cpu, args.a_offset, args.a_ld, - b_mat_cpu, args.b_offset, args.b_ld, args.beta, - c_mat_cpu, args.c_offset, args.c_ld); - buffers.c_mat.Write(queue, args.c_size, c_mat_cpu); + buffers_host.a_mat, args.a_offset, args.a_ld, + buffers_host.b_mat, args.b_offset, args.b_ld, args.beta, + buffers_host.c_mat, args.c_offset, args.c_ld); return StatusCode::kSuccess; } #endif |