summaryrefslogtreecommitdiff
path: root/test/routines/level1
diff options
context:
space:
mode:
Diffstat (limited to 'test/routines/level1')
-rw-r--r--test/routines/level1/xamax.hpp13
-rw-r--r--test/routines/level1/xasum.hpp13
-rw-r--r--test/routines/level1/xaxpy.hpp13
-rw-r--r--test/routines/level1/xcopy.hpp13
-rw-r--r--test/routines/level1/xdot.hpp17
-rw-r--r--test/routines/level1/xdotc.hpp17
-rw-r--r--test/routines/level1/xdotu.hpp17
-rw-r--r--test/routines/level1/xnrm2.hpp13
-rw-r--r--test/routines/level1/xscal.hpp9
-rw-r--r--test/routines/level1/xswap.hpp14
10 files changed, 52 insertions, 87 deletions
diff --git a/test/routines/level1/xamax.hpp b/test/routines/level1/xamax.hpp
index a22f681f..2e844f2c 100644
--- a/test/routines/level1/xamax.hpp
+++ b/test/routines/level1/xamax.hpp
@@ -43,6 +43,8 @@ class TestXamax {
kArgXInc,
kArgXOffset, kArgImaxOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufScalar}; }
+ static std::vector<std::string> BuffersOut() { return {kBufScalar}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -101,15 +103,10 @@ class TestXamax {
// 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> scalar_cpu(args.scalar_size, static_cast<T>(0));
- std::vector<T> x_vec_cpu(args.x_size, static_cast<T>(0));
- buffers.scalar.Read(queue, args.scalar_size, scalar_cpu);
- buffers.x_vec.Read(queue, args.x_size, x_vec_cpu);
+ static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue &) {
cblasXamax(args.n,
- scalar_cpu, args.imax_offset,
- x_vec_cpu, args.x_offset, args.x_inc);
- buffers.scalar.Write(queue, args.scalar_size, scalar_cpu);
+ buffers_host.scalar, args.imax_offset,
+ buffers_host.x_vec, args.x_offset, args.x_inc);
return StatusCode::kSuccess;
}
#endif
diff --git a/test/routines/level1/xasum.hpp b/test/routines/level1/xasum.hpp
index 64377189..8488bfc6 100644
--- a/test/routines/level1/xasum.hpp
+++ b/test/routines/level1/xasum.hpp
@@ -43,6 +43,8 @@ class TestXasum {
kArgXInc,
kArgXOffset, kArgAsumOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufScalar}; }
+ static std::vector<std::string> BuffersOut() { return {kBufScalar}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -101,15 +103,10 @@ class TestXasum {
// 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> scalar_cpu(args.scalar_size, static_cast<T>(0));
- std::vector<T> x_vec_cpu(args.x_size, static_cast<T>(0));
- buffers.scalar.Read(queue, args.scalar_size, scalar_cpu);
- buffers.x_vec.Read(queue, args.x_size, x_vec_cpu);
+ static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue &) {
cblasXasum(args.n,
- scalar_cpu, args.asum_offset,
- x_vec_cpu, args.x_offset, args.x_inc);
- buffers.scalar.Write(queue, args.scalar_size, scalar_cpu);
+ buffers_host.scalar, args.asum_offset,
+ buffers_host.x_vec, args.x_offset, args.x_inc);
return StatusCode::kSuccess;
}
#endif
diff --git a/test/routines/level1/xaxpy.hpp b/test/routines/level1/xaxpy.hpp
index eba067c0..cc7d251a 100644
--- a/test/routines/level1/xaxpy.hpp
+++ b/test/routines/level1/xaxpy.hpp
@@ -44,6 +44,8 @@ class TestXaxpy {
kArgXOffset, kArgYOffset,
kArgAlpha};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufVecY}; }
+ static std::vector<std::string> BuffersOut() { return {kBufVecY}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -102,15 +104,10 @@ class TestXaxpy {
// 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 &) {
cblasXaxpy(args.n, args.alpha,
- x_vec_cpu, args.x_offset, args.x_inc,
- y_vec_cpu, args.y_offset, args.y_inc);
- 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
diff --git a/test/routines/level1/xcopy.hpp b/test/routines/level1/xcopy.hpp
index 753f0da5..0dbf0f3d 100644
--- a/test/routines/level1/xcopy.hpp
+++ b/test/routines/level1/xcopy.hpp
@@ -43,6 +43,8 @@ class TestXcopy {
kArgXInc, kArgYInc,
kArgXOffset, kArgYOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufVecY}; }
+ static std::vector<std::string> BuffersOut() { return {kBufVecY}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -101,15 +103,10 @@ class TestXcopy {
// 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 &) {
cblasXcopy(args.n,
- x_vec_cpu, args.x_offset, args.x_inc,
- y_vec_cpu, args.y_offset, args.y_inc);
- 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
diff --git a/test/routines/level1/xdot.hpp b/test/routines/level1/xdot.hpp
index 8127247d..bdf2e721 100644
--- a/test/routines/level1/xdot.hpp
+++ b/test/routines/level1/xdot.hpp
@@ -43,6 +43,8 @@ class TestXdot {
kArgXInc, kArgYInc,
kArgXOffset, kArgYOffset, kArgDotOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufVecY, kBufScalar}; }
+ static std::vector<std::string> BuffersOut() { return {kBufScalar}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -107,18 +109,11 @@ class TestXdot {
// 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> scalar_cpu(args.scalar_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.scalar.Read(queue, args.scalar_size, scalar_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 &) {
cblasXdot(args.n,
- scalar_cpu, args.dot_offset,
- x_vec_cpu, args.x_offset, args.x_inc,
- y_vec_cpu, args.y_offset, args.y_inc);
- buffers.scalar.Write(queue, args.scalar_size, scalar_cpu);
+ buffers_host.scalar, args.dot_offset,
+ buffers_host.x_vec, args.x_offset, args.x_inc,
+ buffers_host.y_vec, args.y_offset, args.y_inc);
return StatusCode::kSuccess;
}
#endif
diff --git a/test/routines/level1/xdotc.hpp b/test/routines/level1/xdotc.hpp
index 96d97dc4..2cc71b93 100644
--- a/test/routines/level1/xdotc.hpp
+++ b/test/routines/level1/xdotc.hpp
@@ -43,6 +43,8 @@ class TestXdotc {
kArgXInc, kArgYInc,
kArgXOffset, kArgYOffset, kArgDotOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufVecY, kBufScalar}; }
+ static std::vector<std::string> BuffersOut() { return {kBufScalar}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -107,18 +109,11 @@ class TestXdotc {
// 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> scalar_cpu(args.scalar_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.scalar.Read(queue, args.scalar_size, scalar_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 &) {
cblasXdotc(args.n,
- scalar_cpu, args.dot_offset,
- x_vec_cpu, args.x_offset, args.x_inc,
- y_vec_cpu, args.y_offset, args.y_inc);
- buffers.scalar.Write(queue, args.scalar_size, scalar_cpu);
+ buffers_host.scalar, args.dot_offset,
+ buffers_host.x_vec, args.x_offset, args.x_inc,
+ buffers_host.y_vec, args.y_offset, args.y_inc);
return StatusCode::kSuccess;
}
#endif
diff --git a/test/routines/level1/xdotu.hpp b/test/routines/level1/xdotu.hpp
index 70c7fceb..272e1e31 100644
--- a/test/routines/level1/xdotu.hpp
+++ b/test/routines/level1/xdotu.hpp
@@ -43,6 +43,8 @@ class TestXdotu {
kArgXInc, kArgYInc,
kArgXOffset, kArgYOffset, kArgDotOffset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufVecY, kBufScalar}; }
+ static std::vector<std::string> BuffersOut() { return {kBufScalar}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -107,18 +109,11 @@ class TestXdotu {
// 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> scalar_cpu(args.scalar_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.scalar.Read(queue, args.scalar_size, scalar_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 &) {
cblasXdotu(args.n,
- scalar_cpu, args.dot_offset,
- x_vec_cpu, args.x_offset, args.x_inc,
- y_vec_cpu, args.y_offset, args.y_inc);
- buffers.scalar.Write(queue, args.scalar_size, scalar_cpu);
+ buffers_host.scalar, args.dot_offset,
+ buffers_host.x_vec, args.x_offset, args.x_inc,
+ buffers_host.y_vec, args.y_offset, args.y_inc);
return StatusCode::kSuccess;
}
#endif
diff --git a/test/routines/level1/xnrm2.hpp b/test/routines/level1/xnrm2.hpp
index ce33fe59..cb1ec683 100644
--- a/test/routines/level1/xnrm2.hpp
+++ b/test/routines/level1/xnrm2.hpp
@@ -43,6 +43,8 @@ class TestXnrm2 {
kArgXInc,
kArgXOffset, kArgNrm2Offset};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX, kBufScalar}; }
+ static std::vector<std::string> BuffersOut() { return {kBufScalar}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -101,15 +103,10 @@ class TestXnrm2 {
// 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> scalar_cpu(args.scalar_size, static_cast<T>(0));
- std::vector<T> x_vec_cpu(args.x_size, static_cast<T>(0));
- buffers.scalar.Read(queue, args.scalar_size, scalar_cpu);
- buffers.x_vec.Read(queue, args.x_size, x_vec_cpu);
+ static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue &) {
cblasXnrm2(args.n,
- scalar_cpu, args.nrm2_offset,
- x_vec_cpu, args.x_offset, args.x_inc);
- buffers.scalar.Write(queue, args.scalar_size, scalar_cpu);
+ buffers_host.scalar, args.nrm2_offset,
+ buffers_host.x_vec, args.x_offset, args.x_inc);
return StatusCode::kSuccess;
}
#endif
diff --git a/test/routines/level1/xscal.hpp b/test/routines/level1/xscal.hpp
index d89688b4..3e6b9a38 100644
--- a/test/routines/level1/xscal.hpp
+++ b/test/routines/level1/xscal.hpp
@@ -44,6 +44,8 @@ class TestXscal {
kArgXOffset,
kArgAlpha};
}
+ static std::vector<std::string> BuffersIn() { return {kBufVecX}; }
+ static std::vector<std::string> BuffersOut() { return {kBufVecX}; }
// Describes how to obtain the sizes of the buffers
static size_t GetSizeX(const Arguments<T> &args) {
@@ -96,12 +98,9 @@ class TestXscal {
// 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));
- buffers.x_vec.Read(queue, args.x_size, x_vec_cpu);
+ static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue &) {
cblasXscal(args.n, args.alpha,
- x_vec_cpu, args.x_offset, args.x_inc);
- buffers.x_vec.Write(queue, args.x_size, x_vec_cpu);
+ buffers_host.x_vec, args.x_offset, args.x_inc);
return StatusCode::kSuccess;
}
#endif
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