summaryrefslogtreecommitdiff
path: root/test/routines/levelx
diff options
context:
space:
mode:
Diffstat (limited to 'test/routines/levelx')
-rw-r--r--test/routines/levelx/xaxpybatched.hpp13
-rw-r--r--test/routines/levelx/xgemmbatched.hpp17
-rw-r--r--test/routines/levelx/xinvert.hpp3
-rw-r--r--test/routines/levelx/xomatcopy.hpp3
4 files changed, 36 insertions, 0 deletions
diff --git a/test/routines/levelx/xaxpybatched.hpp b/test/routines/levelx/xaxpybatched.hpp
index d8b3837c..add6c1e1 100644
--- a/test/routines/levelx/xaxpybatched.hpp
+++ b/test/routines/levelx/xaxpybatched.hpp
@@ -125,6 +125,19 @@ class TestXaxpyBatched {
}
#endif
+ // Describes how to run the cuBLAS routine (for correctness/performance comparison)
+ #ifdef CLBLAST_REF_CUBLAS
+ static StatusCode RunReference3(const Arguments<T> &args, BuffersCUDA<T> &buffers, Queue &) {
+ for (auto batch = size_t{0}; batch < args.batch_count; ++batch) {
+ auto status = cublasXaxpy(args.n, args.alphas[batch],
+ buffers.x_vec, args.x_offsets[batch], args.x_inc,
+ buffers.y_vec, args.y_offsets[batch], args.y_inc);
+ if (status != CUBLAS_STATUS_SUCCESS) { return StatusCode::kUnknownError; }
+ }
+ return StatusCode::kSuccess;
+ }
+ #endif
+
// Describes how to download the results of the computation
static std::vector<T> DownloadResult(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) {
std::vector<T> result(args.y_size, static_cast<T>(0));
diff --git a/test/routines/levelx/xgemmbatched.hpp b/test/routines/levelx/xgemmbatched.hpp
index e13e9382..ae8630c0 100644
--- a/test/routines/levelx/xgemmbatched.hpp
+++ b/test/routines/levelx/xgemmbatched.hpp
@@ -160,6 +160,23 @@ class TestXgemmBatched {
}
#endif
+ // Describes how to run the cuBLAS routine (for correctness/performance comparison)
+ #ifdef CLBLAST_REF_CUBLAS
+ static StatusCode RunReference3(const Arguments<T> &args, BuffersCUDA<T> &buffers, Queue &) {
+ for (auto batch = size_t{0}; batch < args.batch_count; ++batch) {
+ auto status = cublasXgemm(args.layout,
+ convertToCUBLAS(args.a_transpose),
+ convertToCUBLAS(args.b_transpose),
+ args.m, args.n, args.k, args.alphas[batch],
+ buffers.a_mat, args.a_offsets[batch], args.a_ld,
+ buffers.b_mat, args.b_offsets[batch], args.b_ld, args.betas[batch],
+ buffers.c_mat, args.c_offsets[batch], args.c_ld);
+ if (status != CUBLAS_STATUS_SUCCESS) { return StatusCode::kUnknownError; }
+ }
+ return StatusCode::kSuccess;
+ }
+ #endif
+
// Describes how to download the results of the computation (more importantly: which buffer)
static std::vector<T> DownloadResult(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) {
std::vector<T> result(args.c_size, static_cast<T>(0));
diff --git a/test/routines/levelx/xinvert.hpp b/test/routines/levelx/xinvert.hpp
index ffb484b0..ac9e9a2d 100644
--- a/test/routines/levelx/xinvert.hpp
+++ b/test/routines/levelx/xinvert.hpp
@@ -192,6 +192,9 @@ class TestXinvert {
static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue&) {
return RunReference(args, buffers_host);
}
+ static StatusCode RunReference3(const Arguments<T> &args, BuffersCUDA<T> &buffers, Queue &) {
+ return StatusCode::kUnknownError;
+ }
// Describes how to download the results of the computation (more importantly: which buffer)
static std::vector<T> DownloadResult(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) {
diff --git a/test/routines/levelx/xomatcopy.hpp b/test/routines/levelx/xomatcopy.hpp
index d5973b4c..2e77e6f7 100644
--- a/test/routines/levelx/xomatcopy.hpp
+++ b/test/routines/levelx/xomatcopy.hpp
@@ -151,6 +151,9 @@ class TestXomatcopy {
static StatusCode RunReference2(const Arguments<T> &args, BuffersHost<T> &buffers_host, Queue&) {
return RunReference(args, buffers_host);
}
+ static StatusCode RunReference3(const Arguments<T> &args, BuffersCUDA<T> &buffers, Queue &) {
+ return StatusCode::kUnknownError;
+ }
// Describes how to download the results of the computation (more importantly: which buffer)
static std::vector<T> DownloadResult(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) {