summaryrefslogtreecommitdiff
path: root/test/routines/levelx/xgemmbatched.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/routines/levelx/xgemmbatched.hpp')
-rw-r--r--test/routines/levelx/xgemmbatched.hpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/routines/levelx/xgemmbatched.hpp b/test/routines/levelx/xgemmbatched.hpp
index ab5f20c5..ebfd8b19 100644
--- a/test/routines/levelx/xgemmbatched.hpp
+++ b/test/routines/levelx/xgemmbatched.hpp
@@ -16,15 +16,7 @@
#ifndef CLBLAST_TEST_ROUTINES_XGEMMBATCHED_H_
#define CLBLAST_TEST_ROUTINES_XGEMMBATCHED_H_
-#include <vector>
-#include <string>
-
-#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 {
// =================================================================================================
@@ -168,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(reinterpret_cast<cublasHandle_t>(args.cublas_handle), 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));