diff options
Diffstat (limited to 'test/routines/level1')
-rw-r--r-- | test/routines/level1/xamax.hpp | 10 | ||||
-rw-r--r-- | test/routines/level1/xasum.hpp | 10 | ||||
-rw-r--r-- | test/routines/level1/xaxpy.hpp | 10 | ||||
-rw-r--r-- | test/routines/level1/xcopy.hpp | 10 | ||||
-rw-r--r-- | test/routines/level1/xdot.hpp | 11 | ||||
-rw-r--r-- | test/routines/level1/xdotc.hpp | 11 | ||||
-rw-r--r-- | test/routines/level1/xdotu.hpp | 11 | ||||
-rw-r--r-- | test/routines/level1/xnrm2.hpp | 10 | ||||
-rw-r--r-- | test/routines/level1/xscal.hpp | 9 | ||||
-rw-r--r-- | test/routines/level1/xswap.hpp | 10 |
10 files changed, 102 insertions, 0 deletions
diff --git a/test/routines/level1/xamax.hpp b/test/routines/level1/xamax.hpp index fccefc73..dcd48a47 100644 --- a/test/routines/level1/xamax.hpp +++ b/test/routines/level1/xamax.hpp @@ -103,6 +103,16 @@ class TestXamax { } #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 = cublasXamax(args.n, + buffers.scalar, args.imax_offset, + buffers.x_vec, args.x_offset, args.x_inc); + 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.scalar_size, static_cast<T>(0)); diff --git a/test/routines/level1/xasum.hpp b/test/routines/level1/xasum.hpp index f0fca4d3..e7e41fe5 100644 --- a/test/routines/level1/xasum.hpp +++ b/test/routines/level1/xasum.hpp @@ -103,6 +103,16 @@ class TestXasum { } #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 = cublasXasum(args.n, + buffers.scalar, args.asum_offset, + buffers.x_vec, args.x_offset, args.x_inc); + 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.scalar_size, static_cast<T>(0)); diff --git a/test/routines/level1/xaxpy.hpp b/test/routines/level1/xaxpy.hpp index 8426d739..98f0e380 100644 --- a/test/routines/level1/xaxpy.hpp +++ b/test/routines/level1/xaxpy.hpp @@ -104,6 +104,16 @@ class TestXaxpy { } #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 = cublasXaxpy(args.n, args.alpha, + buffers.x_vec, args.x_offset, args.x_inc, + buffers.y_vec, args.y_offset, args.y_inc); + 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.y_size, static_cast<T>(0)); diff --git a/test/routines/level1/xcopy.hpp b/test/routines/level1/xcopy.hpp index d1e7f49e..65e498ee 100644 --- a/test/routines/level1/xcopy.hpp +++ b/test/routines/level1/xcopy.hpp @@ -103,6 +103,16 @@ class TestXcopy { } #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 = cublasXcopy(args.n, + buffers.x_vec, args.x_offset, args.x_inc, + buffers.y_vec, args.y_offset, args.y_inc); + 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.y_size, static_cast<T>(0)); diff --git a/test/routines/level1/xdot.hpp b/test/routines/level1/xdot.hpp index cb3d7979..c95b16ef 100644 --- a/test/routines/level1/xdot.hpp +++ b/test/routines/level1/xdot.hpp @@ -110,6 +110,17 @@ class TestXdot { } #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 = cublasXdot(args.n, + buffers.scalar, args.dot_offset, + buffers.x_vec, args.x_offset, args.x_inc, + buffers.y_vec, args.y_offset, args.y_inc); + 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.scalar_size, static_cast<T>(0)); diff --git a/test/routines/level1/xdotc.hpp b/test/routines/level1/xdotc.hpp index 10ecbda6..0c99be25 100644 --- a/test/routines/level1/xdotc.hpp +++ b/test/routines/level1/xdotc.hpp @@ -110,6 +110,17 @@ class TestXdotc { } #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 = cublasXdotc(args.n, + buffers.scalar, args.dot_offset, + buffers.x_vec, args.x_offset, args.x_inc, + buffers.y_vec, args.y_offset, args.y_inc); + 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.scalar_size, static_cast<T>(0)); diff --git a/test/routines/level1/xdotu.hpp b/test/routines/level1/xdotu.hpp index 6efd270e..bf6bcd80 100644 --- a/test/routines/level1/xdotu.hpp +++ b/test/routines/level1/xdotu.hpp @@ -110,6 +110,17 @@ class TestXdotu { } #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 = cublasXdotu(args.n, + buffers.scalar, args.dot_offset, + buffers.x_vec, args.x_offset, args.x_inc, + buffers.y_vec, args.y_offset, args.y_inc); + 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.scalar_size, static_cast<T>(0)); diff --git a/test/routines/level1/xnrm2.hpp b/test/routines/level1/xnrm2.hpp index 0ba24b13..096604d1 100644 --- a/test/routines/level1/xnrm2.hpp +++ b/test/routines/level1/xnrm2.hpp @@ -103,6 +103,16 @@ class TestXnrm2 { } #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 = cublasXnrm2(args.n, + buffers.scalar, args.nrm2_offset, + buffers.x_vec, args.x_offset, args.x_inc); + 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.scalar_size, static_cast<T>(0)); diff --git a/test/routines/level1/xscal.hpp b/test/routines/level1/xscal.hpp index e7db434e..09b53839 100644 --- a/test/routines/level1/xscal.hpp +++ b/test/routines/level1/xscal.hpp @@ -97,6 +97,15 @@ class TestXscal { } #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 = cublasXscal(args.n, args.alpha, + buffers.x_vec, args.x_offset, args.x_inc); + 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.x_size, static_cast<T>(0)); diff --git a/test/routines/level1/xswap.hpp b/test/routines/level1/xswap.hpp index 64feb744..0d6fe451 100644 --- a/test/routines/level1/xswap.hpp +++ b/test/routines/level1/xswap.hpp @@ -103,6 +103,16 @@ class TestXswap { } #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 = cublasXswap(args.n, + buffers.x_vec, args.x_offset, args.x_inc, + buffers.y_vec, args.y_offset, args.y_inc); + 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.x_size + args.y_size, static_cast<T>(0)); |