summaryrefslogtreecommitdiff
path: root/test/routines/level1/xswap.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-04-01 13:36:24 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-04-01 13:36:24 +0200
commitb84d2296b87ac212474af855d916b12adf96bdb7 (patch)
tree0f2e85e1e1acef1d22f046499dd0b8a30e5da4f9 /test/routines/level1/xswap.hpp
parenta98c00a2671b8981579f3a73dca8fb3365a95e53 (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/level1/xswap.hpp')
-rw-r--r--test/routines/level1/xswap.hpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/routines/level1/xswap.hpp b/test/routines/level1/xswap.hpp
index 49b0d3d0..d9b84dc4 100644
--- a/test/routines/level1/xswap.hpp
+++ b/test/routines/level1/xswap.hpp
@@ -43,6 +43,8 @@ class TestXswap {
kArgXInc, kArgYInc,
kArgXOffset, kArgYOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufVecY}; }
+ static std::vector<std::string> BuffersOut() { return {kBufVecX, kBufVecY}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -101,16 +103,10 @@ class TestXswap {
// 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> x_vec_cpu(args.x_size, static_cast<T>(0));
- std::vector<T> y_vec_cpu(args.y_size, static_cast<T>(0));
- 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 &) {
cblasXswap(args.n,
- x_vec_cpu, args.x_offset, args.x_inc,
- y_vec_cpu, args.y_offset, args.y_inc);
- buffers.x_vec.Write(queue, args.x_size, x_vec_cpu);
- buffers.y_vec.Write(queue, args.y_size, y_vec_cpu);
+ buffers_host.x_vec, args.x_offset, args.x_inc,
+ buffers_host.y_vec, args.y_offset, args.y_inc);
return StatusCode::kSuccess;
}
#endif