Go to the documentation of this file.
27#ifndef OPM_CUBLASWRAPPER_HEADER_INCLUDED
28#define OPM_CUBLASWRAPPER_HEADER_INCLUDED
30#include <opm/common/ErrorMacros.hpp>
42 return cublasDscal(handle,
56 return cublasSscal(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;
84 return cublasDaxpy(handle,
102 return cublasSaxpy(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);
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);
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;
Definition: autotuner.hpp:30
cublasStatus_t cublasAxpy(cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy) Definition: cublas_wrapper.hpp:76
cublasStatus_t cublasNrm2(cublasHandle_t handle, int n, const double *x, int incx, double *result) Definition: cublas_wrapper.hpp:154
cublasStatus_t cublasScal(cublasHandle_t handle, int n, const double *alpha, double *x, int incx) Definition: cublas_wrapper.hpp:36
cublasStatus_t cublasDot(cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result) Definition: cublas_wrapper.hpp:127
|