mgcpp
A C++ Math Library Based on CUDA
Functions
mgcpp::cublas Namespace Reference

Functions

template<typename T >
outcome::result< void > dot (cublasHandle_t handle, size_t n, T const *x, size_t incx, T const *y, size_t incy, T *result) noexcept
 
template<typename T >
outcome::result< void > axpy (cublasHandle_t handle, size_t n, T const *alpha, T const *x, size_t incx, T *y, size_t incy) noexcept
 
template<typename VectorType , typename ScalarType >
outcome::result< void > scal (cublasHandle_t handle, size_t n, ScalarType const *alpha, VectorType *vec, size_t incvec) noexcept
 
template<typename T >
outcome::result< void > gemv (cublasHandle_t handle, cublasOperation_t trans, int m, int n, T const *alpha, T const *A, int lda, T const *x, int incx, T const *beta, T *y, int incy)
 
template<typename T >
outcome::result< void > ger (cublasHandle_t handle, size_t m, size_t n, T const *alpha, T const *x, size_t incx, T const *y, size_t incy, T *A, int lda)
 This function performs the rank-1 update. More...
 
template<typename T >
outcome::result< void > gemm (cublasHandle_t handle, cublasOperation_t transa, cublasOperation_t transb, size_t m, size_t n, size_t k, T const *alpha, T const *A, size_t lda, T const *B, size_t ldb, T const *beta, T *C, size_t ldc) noexcept
 
template<typename T >
outcome::result< void > gemm_batched (cublasHandle_t handle, cublasOperation_t transa, cublasOperation_t transb, size_t m, size_t n, size_t k, T const *alpha, T const *A, size_t lda, T const *B, size_t ldb, T const *beta, T *C, size_t ldc) noexcept
 
template<typename T >
outcome::result< void > geam (cublasHandle_t handle, cublasOperation_t transa, cublasOperation_t transb, size_t m, size_t n, const T *alpha, const T *A, size_t lda, const T *beta, const T *B, size_t ldb, T *C, size_t ldc) noexcept
 

Function Documentation

◆ axpy()

template<typename T >
outcome::result<void> mgcpp::cublas::axpy ( cublasHandle_t  handle,
size_t  n,
T const *  alpha,
T const *  x,
size_t  incx,
T *  y,
size_t  incy 
)
noexcept

◆ dot()

template<typename T >
outcome::result<void> mgcpp::cublas::dot ( cublasHandle_t  handle,
size_t  n,
T const *  x,
size_t  incx,
T const *  y,
size_t  incy,
T *  result 
)
noexcept

◆ geam()

template<typename T >
outcome::result<void> mgcpp::cublas::geam ( cublasHandle_t  handle,
cublasOperation_t  transa,
cublasOperation_t  transb,
size_t  m,
size_t  n,
const T *  alpha,
const T *  A,
size_t  lda,
const T *  beta,
const T *  B,
size_t  ldb,
T *  C,
size_t  ldc 
)
noexcept

◆ gemm()

template<typename T >
outcome::result<void> mgcpp::cublas::gemm ( cublasHandle_t  handle,
cublasOperation_t  transa,
cublasOperation_t  transb,
size_t  m,
size_t  n,
size_t  k,
T const *  alpha,
T const *  A,
size_t  lda,
T const *  B,
size_t  ldb,
T const *  beta,
T *  C,
size_t  ldc 
)
noexcept

◆ gemm_batched()

template<typename T >
outcome::result<void> mgcpp::cublas::gemm_batched ( cublasHandle_t  handle,
cublasOperation_t  transa,
cublasOperation_t  transb,
size_t  m,
size_t  n,
size_t  k,
T const *  alpha,
T const *  A,
size_t  lda,
T const *  B,
size_t  ldb,
T const *  beta,
T *  C,
size_t  ldc 
)
noexcept

◆ gemv()

template<typename T >
outcome::result<void> mgcpp::cublas::gemv ( cublasHandle_t  handle,
cublasOperation_t  trans,
int  m,
int  n,
T const *  alpha,
T const *  A,
int  lda,
T const *  x,
int  incx,
T const *  beta,
T *  y,
int  incy 
)

matrix-vector multiplication y = alpha * op(A) * x + beta * y

Parameters
handlehandle to the cuBLAS library context
transoperation op(A) that is non- or (conj.) transpose.
mnumber of rows of matrix A.
nnumber of columns of matrix A.
alphascalar used for multiplication.
Aarray of dimension (lda, n)
ldaleading dimension of two-dimensional array used to store matrix A. lda must be at least max{1, m}
xvector at least (1+(n-1)*abs(incx)) elements if transa==CUBLAS_OP_N and at least (1+(m-1)*abs(incx)) elements otherwise.
incxstride between consecutive elements of x.
betascalar used for multiplication, if beta==0 then y does not have to be a valid input.
yvector at least (1+(m-1)*abs(incy)) elements if transa==CUBLAS_OP_N and at least (1+(n-1)*abs(incy)) elements otherwise.
incystride between consecutive elements of y.

◆ ger()

template<typename T >
outcome::result<void> mgcpp::cublas::ger ( cublasHandle_t  handle,
size_t  m,
size_t  n,
T const *  alpha,
T const *  x,
size_t  incx,
T const *  y,
size_t  incy,
T *  A,
int  lda 
)

This function performs the rank-1 update.

◆ scal()

template<typename VectorType , typename ScalarType >
outcome::result<void> mgcpp::cublas::scal ( cublasHandle_t  handle,
size_t  n,
ScalarType const *  alpha,
VectorType *  vec,
size_t  incvec 
)
noexcept