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.");
73cublasAxpy(cublasHandle_t handle,
81 return cublasDaxpy(handle,
91cublasAxpy(cublasHandle_t handle,
99 return cublasSaxpy(handle,
109cublasAxpy([[maybe_unused]] cublasHandle_t handle,
110 [[maybe_unused]]
int n,
111 [[maybe_unused]]
const int* alpha,
112 [[maybe_unused]]
const int* x,
113 [[maybe_unused]]
int incx,
114 [[maybe_unused]]
int* y,
115 [[maybe_unused]]
int incy)
117 OPM_THROW(std::runtime_error,
"axpy multiplication for integer vectors is not implemented yet.");
121cublasDot(cublasHandle_t handle,
int n,
const double* x,
int incx,
const double* y,
int incy,
double* result)
123 return cublasDdot(handle, n, x, incx, y, incy, result);
127cublasDot(cublasHandle_t handle,
int n,
const float* x,
int incx,
const float* y,
int incy,
float* result)
129 return cublasSdot(handle, n, x, incx, y, incy, result);
133cublasDot([[maybe_unused]] cublasHandle_t handle,
134 [[maybe_unused]]
int n,
135 [[maybe_unused]]
const int* x,
136 [[maybe_unused]]
int incx,
137 [[maybe_unused]]
const int* y,
138 [[maybe_unused]]
int incy,
139 [[maybe_unused]]
int* result)
141 OPM_THROW(std::runtime_error,
"inner product for integer vectors is not implemented yet.");
145cublasNrm2(cublasHandle_t handle,
int n,
const double* x,
int incx,
double* result)
147 return cublasDnrm2(handle, n, x, incx, result);
152cublasNrm2(cublasHandle_t handle,
int n,
const float* x,
int incx,
float* result)
154 return cublasSnrm2(handle, n, x, incx, result);
158cublasNrm2([[maybe_unused]] cublasHandle_t handle,
159 [[maybe_unused]]
int n,
160 [[maybe_unused]]
const int* x,
161 [[maybe_unused]]
int incx,
162 [[maybe_unused]]
int* result)
164 OPM_THROW(std::runtime_error,
"norm2 for integer vectors is not implemented yet.");
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Definition cublas_safe_call.hpp:32