diff options
Diffstat (limited to 'test/routines/level3')
-rw-r--r-- | test/routines/level3/xgemm.hpp | 14 | ||||
-rw-r--r-- | test/routines/level3/xhemm.hpp | 14 | ||||
-rw-r--r-- | test/routines/level3/xher2k.hpp | 14 | ||||
-rw-r--r-- | test/routines/level3/xherk.hpp | 13 | ||||
-rw-r--r-- | test/routines/level3/xsymm.hpp | 14 | ||||
-rw-r--r-- | test/routines/level3/xsyr2k.hpp | 14 | ||||
-rw-r--r-- | test/routines/level3/xsyrk.hpp | 13 | ||||
-rw-r--r-- | test/routines/level3/xtrmm.hpp | 15 | ||||
-rw-r--r-- | test/routines/level3/xtrsm.hpp | 15 |
9 files changed, 126 insertions, 0 deletions
diff --git a/test/routines/level3/xgemm.hpp b/test/routines/level3/xgemm.hpp index d6ad98f9..36fa2f43 100644 --- a/test/routines/level3/xgemm.hpp +++ b/test/routines/level3/xgemm.hpp @@ -127,6 +127,20 @@ class TestXgemm { } #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 &) { + auto status = cublasXgemm(args.layout, + convertToCUBLAS(args.a_transpose), + convertToCUBLAS(args.b_transpose), + args.m, args.n, args.k, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld, args.beta, + buffers.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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/level3/xhemm.hpp b/test/routines/level3/xhemm.hpp index beadf62d..9400a1fc 100644 --- a/test/routines/level3/xhemm.hpp +++ b/test/routines/level3/xhemm.hpp @@ -127,6 +127,20 @@ class TestXhemm { } #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 &) { + auto status = cublasXhemm(args.layout, + convertToCUBLAS(args.side), + convertToCUBLAS(args.triangle), + args.m, args.n, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld, args.beta, + buffers.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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/level3/xher2k.hpp b/test/routines/level3/xher2k.hpp index b5d22579..b341c4d7 100644 --- a/test/routines/level3/xher2k.hpp +++ b/test/routines/level3/xher2k.hpp @@ -128,6 +128,20 @@ class TestXher2k { } #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 &) { + auto status = cublasXher2k(args.layout, + convertToCUBLAS(args.triangle), + convertToCUBLAS(args.a_transpose), + args.n, args.k, alpha2, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld, args.beta, + buffers.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #endif + // Describes how to download the results of the computation (more importantly: which buffer) static std::vector<T> DownloadResult(const Arguments<U> &args, Buffers<T> &buffers, Queue &queue) { std::vector<T> result(args.c_size, static_cast<T>(0)); diff --git a/test/routines/level3/xherk.hpp b/test/routines/level3/xherk.hpp index 558f4e76..676d5286 100644 --- a/test/routines/level3/xherk.hpp +++ b/test/routines/level3/xherk.hpp @@ -115,6 +115,19 @@ class TestXherk { } #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 &) { + auto status = cublasXherk(args.layout, + convertToCUBLAS(args.triangle), + convertToCUBLAS(args.a_transpose), + args.n, args.k, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, args.beta, + buffers.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #endif + // Describes how to download the results of the computation (more importantly: which buffer) static std::vector<T> DownloadResult(const Arguments<U> &args, Buffers<T> &buffers, Queue &queue) { std::vector<T> result(args.c_size, static_cast<T>(0)); diff --git a/test/routines/level3/xsymm.hpp b/test/routines/level3/xsymm.hpp index 704a8f9e..4888091b 100644 --- a/test/routines/level3/xsymm.hpp +++ b/test/routines/level3/xsymm.hpp @@ -127,6 +127,20 @@ class TestXsymm { } #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 &) { + auto status = cublasXsymm(args.layout, + convertToCUBLAS(args.side), + convertToCUBLAS(args.triangle), + args.m, args.n, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld, args.beta, + buffers.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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/level3/xsyr2k.hpp b/test/routines/level3/xsyr2k.hpp index c321b9cf..2fc4090c 100644 --- a/test/routines/level3/xsyr2k.hpp +++ b/test/routines/level3/xsyr2k.hpp @@ -125,6 +125,20 @@ class TestXsyr2k { } #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 &) { + auto status = cublasXsyr2k(args.layout, + convertToCUBLAS(args.triangle), + convertToCUBLAS(args.a_transpose), + args.n, args.k, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld, args.beta, + buffers.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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/level3/xsyrk.hpp b/test/routines/level3/xsyrk.hpp index 00a3013d..2ee24a2e 100644 --- a/test/routines/level3/xsyrk.hpp +++ b/test/routines/level3/xsyrk.hpp @@ -115,6 +115,19 @@ class TestXsyrk { } #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 &) { + auto status = cublasXsyrk(args.layout, + convertToCUBLAS(args.triangle), + convertToCUBLAS(args.a_transpose), + args.n, args.k, args.alpha, + buffer.a_mat, args.a_offset, args.a_ld, args.beta, + buffer.c_mat, args.c_offset, args.c_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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/level3/xtrmm.hpp b/test/routines/level3/xtrmm.hpp index 660001df..abf77db9 100644 --- a/test/routines/level3/xtrmm.hpp +++ b/test/routines/level3/xtrmm.hpp @@ -119,6 +119,21 @@ class TestXtrmm { } #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 &) { + auto status = cublasXtrmm(args.layout, + convertToCUBLAS(args.side), + convertToCUBLAS(args.triangle), + convertToCUBLAS(args.a_transpose), + convertToCUBLAS(args.diagonal), + args.m, args.n, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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.b_size, static_cast<T>(0)); diff --git a/test/routines/level3/xtrsm.hpp b/test/routines/level3/xtrsm.hpp index 9e8b9565..10b216cc 100644 --- a/test/routines/level3/xtrsm.hpp +++ b/test/routines/level3/xtrsm.hpp @@ -130,6 +130,21 @@ class TestXtrsm { } #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 &) { + auto status = cublasXtrsm(args.layout, + convertToCUBLAS(args.side), + convertToCUBLAS(args.triangle), + convertToCUBLAS(args.a_transpose), + convertToCUBLAS(args.diagonal), + args.m, args.n, args.alpha, + buffers.a_mat, args.a_offset, args.a_ld, + buffers.b_mat, args.b_offset, args.b_ld); + if (status == CUBLAS_STATUS_SUCCESS) { return StatusCode::kSuccess; } else { return StatusCode::kUnknownError; } + } + #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.b_size, static_cast<T>(0)); |