diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-04-02 14:59:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-02 14:59:39 +0200 |
commit | 5079fbaeffe38cd26ea2fa878bdbb2de5b140bcf (patch) | |
tree | 0f2e85e1e1acef1d22f046499dd0b8a30e5da4f9 /test/routines/level2/xspr2.hpp | |
parent | a98c00a2671b8981579f3a73dca8fb3365a95e53 (diff) | |
parent | b84d2296b87ac212474af855d916b12adf96bdb7 (diff) |
Merge pull request #143 from CNugteren/test_cblas_timing
CBLAS reference code is now separated from device-host copies
Diffstat (limited to 'test/routines/level2/xspr2.hpp')
-rw-r--r-- | test/routines/level2/xspr2.hpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/test/routines/level2/xspr2.hpp b/test/routines/level2/xspr2.hpp index ee517bc1..a7e22227 100644 --- a/test/routines/level2/xspr2.hpp +++ b/test/routines/level2/xspr2.hpp @@ -45,6 +45,8 @@ class TestXspr2 { kArgAPOffset, kArgXOffset, kArgYOffset, kArgAlpha}; } + static std::vector<std::string> BuffersIn() { return {kBufMatAP, kBufVecX, kBufVecY}; } + static std::vector<std::string> BuffersOut() { return {kBufMatAP}; } // Describes how to obtain the sizes of the buffers static size_t GetSizeX(const Arguments<T> &args) { @@ -112,20 +114,13 @@ class TestXspr2 { // Describes how to run the CPU BLAS routine (for correctness/performance comparison) #ifdef CLBLAST_REF_CBLAS - static StatusCode RunReference2(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) { - std::vector<T> ap_mat_cpu(args.ap_size, static_cast<T>(0)); - std::vector<T> x_vec_cpu(args.x_size, static_cast<T>(0)); - std::vector<T> y_vec_cpu(args.y_size, static_cast<T>(0)); - buffers.ap_mat.Read(queue, args.ap_size, ap_mat_cpu); - buffers.x_vec.Read(queue, args.x_size, x_vec_cpu); - buffers.y_vec.Read(queue, args.y_size, y_vec_cpu); + static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue &) { cblasXspr2(convertToCBLAS(args.layout), convertToCBLAS(args.triangle), args.n, args.alpha, - x_vec_cpu, args.x_offset, args.x_inc, - y_vec_cpu, args.y_offset, args.y_inc, - ap_mat_cpu, args.ap_offset); - buffers.ap_mat.Write(queue, args.ap_size, ap_mat_cpu); + buffers_host.x_vec, args.x_offset, args.x_inc, + buffers_host.y_vec, args.y_offset, args.y_inc, + buffers_host.ap_mat, args.ap_offset); return StatusCode::kSuccess; } #endif |