From 6b625f8915ce0596d65187bd3a8eb47e91a0084e Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Mon, 10 Apr 2017 22:54:14 +0200 Subject: Added reference implementations for performance-testing against cuBLAS --- test/routines/levelx/xgemmbatched.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/routines/levelx/xgemmbatched.hpp') 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 &args, BuffersCUDA &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 DownloadResult(const Arguments &args, Buffers &buffers, Queue &queue) { std::vector result(args.c_size, static_cast(0)); -- cgit v1.2.3