summaryrefslogtreecommitdiff
path: root/test/wrapper_cublas.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2023-05-07 20:02:52 +0200
committerGitHub <noreply@github.com>2023-05-07 20:02:52 +0200
commit3d0c227fa5004067d857c74f7963876b34ed4170 (patch)
tree3ff7c3766f1c2f13717ecc4a819da0815fa7cdb3 /test/wrapper_cublas.hpp
parent1573f7d3040ddb6005e71bf4f770566f627236d2 (diff)
AMAX/AMIN integer testing and bug fixes (#457)
* Fixed a bug in XAMAX/XMIN routines that caused the increment and offset to be included in the result * Perform proper integer-output testing in XAMAX tests * A few changes towards getting it ready for a PR * Also fix compilation for clBLAS and cuBLAS references * Fix a bug that would only use the real part of complex numbers in the amax/amin routines * A few small fixes related to the AMAX tests
Diffstat (limited to 'test/wrapper_cublas.hpp')
-rw-r--r--test/wrapper_cublas.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/wrapper_cublas.hpp b/test/wrapper_cublas.hpp
index 35b1b9c6..0a10a5ed 100644
--- a/test/wrapper_cublas.hpp
+++ b/test/wrapper_cublas.hpp
@@ -576,11 +576,11 @@ cublasStatus_t cublasXasum<half>(cublasHandle_t handle, const size_t n,
// Forwards the cuBLAS calls for iSAMAX/iDAMAX/iCAMAX/iZAMAX/iHAMAX
template <typename T>
cublasStatus_t cublasXamax(cublasHandle_t handle, const size_t n,
- T* imax_buffer, const size_t imax_offset,
+ unsigned int * imax_buffer, const size_t imax_offset,
const T* x_buffer, const size_t x_offset, const size_t x_inc);
template <>
cublasStatus_t cublasXamax<float>(cublasHandle_t handle, const size_t n,
- float* imax_buffer, const size_t imax_offset,
+ unsigned int * imax_buffer, const size_t imax_offset,
const float* x_buffer, const size_t x_offset, const size_t x_inc) {
auto status = cublasIsamax(handle, static_cast<int>(n),
&x_buffer[x_offset], static_cast<int>(x_inc),
@@ -590,7 +590,7 @@ cublasStatus_t cublasXamax<float>(cublasHandle_t handle, const size_t n,
}
template <>
cublasStatus_t cublasXamax<double>(cublasHandle_t handle, const size_t n,
- double* imax_buffer, const size_t imax_offset,
+ unsigned int * imax_buffer, const size_t imax_offset,
const double* x_buffer, const size_t x_offset, const size_t x_inc) {
auto status = cublasIdamax(handle, static_cast<int>(n),
&x_buffer[x_offset], static_cast<int>(x_inc),
@@ -600,7 +600,7 @@ cublasStatus_t cublasXamax<double>(cublasHandle_t handle, const size_t n,
}
template <>
cublasStatus_t cublasXamax<float2>(cublasHandle_t handle, const size_t n,
- float2* imax_buffer, const size_t imax_offset,
+ unsigned int * imax_buffer, const size_t imax_offset,
const float2* x_buffer, const size_t x_offset, const size_t x_inc) {
auto status = cublasIcamax(handle, static_cast<int>(n),
reinterpret_cast<const cuComplex*>(&x_buffer[x_offset]), static_cast<int>(x_inc),
@@ -610,7 +610,7 @@ cublasStatus_t cublasXamax<float2>(cublasHandle_t handle, const size_t n,
}
template <>
cublasStatus_t cublasXamax<double2>(cublasHandle_t handle, const size_t n,
- double2* imax_buffer, const size_t imax_offset,
+ unsigned int * imax_buffer, const size_t imax_offset,
const double2* x_buffer, const size_t x_offset, const size_t x_inc) {
auto status = cublasIzamax(handle, static_cast<int>(n),
reinterpret_cast<const cuDoubleComplex*>(&x_buffer[x_offset]), static_cast<int>(x_inc),
@@ -620,7 +620,7 @@ cublasStatus_t cublasXamax<double2>(cublasHandle_t handle, const size_t n,
}
template <>
cublasStatus_t cublasXamax<half>(cublasHandle_t handle, const size_t n,
- half* imax_buffer, const size_t imax_offset,
+ unsigned int * imax_buffer, const size_t imax_offset,
const half* x_buffer, const size_t x_offset, const size_t x_inc) {
return CUBLAS_STATUS_NOT_SUPPORTED;
}