27#ifndef OPM_CUBLASWRAPPER_HEADER_INCLUDED
28#define OPM_CUBLASWRAPPER_HEADER_INCLUDED
30#include <opm/common/ErrorMacros.hpp>
36cublasScal(cublasHandle_t handle,
42 return cublasDscal(handle,
50cublasScal(cublasHandle_t handle,
56 return cublasSscal(handle,
64cublasScal([[maybe_unused]] cublasHandle_t handle,
65 [[maybe_unused]]
int n,
66 [[maybe_unused]]
const int* alpha,
67 [[maybe_unused]]
int* x,
68 [[maybe_unused]]
int incx)
70 OPM_THROW(std::runtime_error,
"cublasScal multiplication for integer vectors is not implemented yet.");
73 return CUBLAS_STATUS_NOT_SUPPORTED;
76cublasAxpy(cublasHandle_t handle,
84 return cublasDaxpy(handle,
94cublasAxpy(cublasHandle_t handle,
102 return cublasSaxpy(handle,
112cublasAxpy([[maybe_unused]] cublasHandle_t handle,
113 [[maybe_unused]]
int n,
114 [[maybe_unused]]
const int* alpha,
115 [[maybe_unused]]
const int* x,
116 [[maybe_unused]]
int incx,
117 [[maybe_unused]]
int* y,
118 [[maybe_unused]]
int incy)
120 OPM_THROW(std::runtime_error,
"axpy multiplication for integer vectors is not implemented yet.");
123 return CUBLAS_STATUS_NOT_SUPPORTED;
127cublasDot(cublasHandle_t handle,
int n,
const double* x,
int incx,
const double* y,
int incy,
double* result)
129 return cublasDdot(handle, n, x, incx, y, incy, result);
133cublasDot(cublasHandle_t handle,
int n,
const float* x,
int incx,
const float* y,
int incy,
float* result)
135 return cublasSdot(handle, n, x, incx, y, incy, result);
139cublasDot([[maybe_unused]] cublasHandle_t handle,
140 [[maybe_unused]]
int n,
141 [[maybe_unused]]
const int* x,
142 [[maybe_unused]]
int incx,
143 [[maybe_unused]]
const int* y,
144 [[maybe_unused]]
int incy,
145 [[maybe_unused]]
int* result)
147 OPM_THROW(std::runtime_error,
"inner product for integer vectors is not implemented yet.");
150 return CUBLAS_STATUS_NOT_SUPPORTED;
154cublasNrm2(cublasHandle_t handle,
int n,
const double* x,
int incx,
double* result)
156 return cublasDnrm2(handle, n, x, incx, result);
161cublasNrm2(cublasHandle_t handle,
int n,
const float* x,
int incx,
float* result)
163 return cublasSnrm2(handle, n, x, incx, result);
167cublasNrm2([[maybe_unused]] cublasHandle_t handle,
168 [[maybe_unused]]
int n,
169 [[maybe_unused]]
const int* x,
170 [[maybe_unused]]
int incx,
171 [[maybe_unused]]
int* result)
173 OPM_THROW(std::runtime_error,
"norm2 for integer vectors is not implemented yet.");
176 return CUBLAS_STATUS_NOT_SUPPORTED;
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Definition autotuner.hpp:30