summaryrefslogtreecommitdiff
path: root/test/routines/levelx/xaxpybatched.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/routines/levelx/xaxpybatched.hpp')
-rw-r--r--test/routines/levelx/xaxpybatched.hpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/routines/levelx/xaxpybatched.hpp b/test/routines/levelx/xaxpybatched.hpp
index 05141bbb..5385e86e 100644
--- a/test/routines/levelx/xaxpybatched.hpp
+++ b/test/routines/levelx/xaxpybatched.hpp
@@ -16,17 +16,7 @@
#ifndef CLBLAST_TEST_ROUTINES_XAXPYBATCHED_H_
#define CLBLAST_TEST_ROUTINES_XAXPYBATCHED_H_
-#include <vector>
-#include <string>
-
-#include "utilities/utilities.hpp"
-
-#ifdef CLBLAST_REF_CLBLAS
- #include "test/wrapper_clblas.hpp"
-#endif
-#ifdef CLBLAST_REF_CBLAS
- #include "test/wrapper_cblas.hpp"
-#endif
+#include "test/routines/common.hpp"
namespace clblast {
// =================================================================================================
@@ -135,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(reinterpret_cast<cublasHandle_t>(args.cublas_handle), 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));