imate
C++/CUDA Reference
cublas_interface Namespace Reference

A collection of templates to wrapper cublas functions. More...

Functions

template<>
cublasStatus_t cublasXgemv< float > (cublasHandle_t handle, cublasOperation_t trans, int m, int n, const float *alpha, const float *A, int lda, const float *x, int incx, const float *beta, float *y, int incy)
 A template wrapper for cublasSgemv. More...
 
template<>
cublasStatus_t cublasXgemv< double > (cublasHandle_t handle, cublasOperation_t trans, int m, int n, const double *alpha, const double *A, int lda, const double *x, int incx, const double *beta, double *y, int incy)
 A template wrapper for cublasDgemv. More...
 
template<>
cublasStatus_t cublasXcopy< float > (cublasHandle_t handle, int n, const float *x, int incx, float *y, int incy)
 A template wrapper for cublasScopy. More...
 
template<>
cublasStatus_t cublasXcopy< double > (cublasHandle_t handle, int n, const double *x, int incx, double *y, int incy)
 A template wrapper for cublasDcopy. More...
 
template<>
cublasStatus_t cublasXaxpy< float > (cublasHandle_t handle, int n, const float *alpha, const float *x, int incx, float *y, int incy)
 A template wrapper for cublasSaxpy. More...
 
template<>
cublasStatus_t cublasXaxpy< double > (cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy)
 A template wrapper for cublasDaxpy. More...
 
template<>
cublasStatus_t cublasXdot< float > (cublasHandle_t handle, int n, const float *x, int incx, const float *y, int incy, float *result)
 A template wrapper for cublasSdot. More...
 
template<>
cublasStatus_t cublasXdot< double > (cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result)
 A template wrapper for cublasDdot. More...
 
template<>
cublasStatus_t cublasXnrm2< float > (cublasHandle_t handle, int n, const float *x, int incx, float *result)
 A template wrapper to cublasSnrm2. More...
 
template<>
cublasStatus_t cublasXnrm2< double > (cublasHandle_t handle, int n, const double *x, int incx, double *result)
 A template wrapper to cublasDnrm2. More...
 
template<>
cublasStatus_t cublasXscal< float > (cublasHandle_t handle, int n, const float *alpha, float *x, int incx)
 A template wrapper for cublasSscal. More...
 
template<>
cublasStatus_t cublasXscal< double > (cublasHandle_t handle, int n, const double *alpha, double *x, int incx)
 A template wrapper for cublasDscal. More...
 
template<typename DataType >
cublasStatus_t cublasXgemv (cublasHandle_t handle, cublasOperation_t trans, int m, int n, const DataType *alpha, const DataType *A, int lda, const DataType *x, int incx, const DataType *beta, DataType *y, int incy)
 
template<typename DataType >
cublasStatus_t cublasXcopy (cublasHandle_t handle, int n, const DataType *x, int incx, DataType *y, int incy)
 
template<typename DataType >
cublasStatus_t cublasXaxpy (cublasHandle_t handle, int n, const DataType *alpha, const DataType *x, int incx, DataType *y, int incy)
 
template<typename DataType >
cublasStatus_t cublasXdot (cublasHandle_t handle, int n, const DataType *x, int incx, const DataType *y, int incy, DataType *result)
 
template<typename DataType >
cublasStatus_t cublasXnrm2 (cublasHandle_t handle, int n, const DataType *x, int incx, DataType *result)
 
template<typename DataType >
cublasStatus_t cublasXscal (cublasHandle_t handle, int n, const DataType *alpha, DataType *x, int incx)
 

Detailed Description

A collection of templates to wrapper cublas functions.

Note
The implementation in the cu file is wrapped inside the namepsace clause. This is not necessary in general, however, it is needed to avoid the old gcc compiler error (this is a gcc bug) which complains "no instance of function template matches the argument list const float".

Function Documentation

◆ cublasXaxpy()

template<typename DataType >
cublasStatus_t cublas_interface::cublasXaxpy ( cublasHandle_t  handle,
int  n,
const DataType *  alpha,
const DataType *  x,
int  incx,
DataType *  y,
int  incy 
)

Referenced by cuVectorOperations< DataType >::subtract_scaled_vector().

Here is the caller graph for this function:

◆ cublasXaxpy< double >()

template<>
cublasStatus_t cublas_interface::cublasXaxpy< double > ( cublasHandle_t  handle,
int  n,
const double *  alpha,
const double *  x,
int  incx,
double *  y,
int  incy 
)

A template wrapper for cublasDaxpy.

Definition at line 156 of file cublas_interface.cu.

164  {
165  return cublasDaxpy(handle, n, alpha, x, incx, y, incy);
166  }
cublasStatus_t cublasDaxpy(cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy)
Definition of CUDA's cublasDaxpy function using dynamically loaded cublas library.

References cublasDaxpy().

Here is the call graph for this function:

◆ cublasXaxpy< float >()

template<>
cublasStatus_t cublas_interface::cublasXaxpy< float > ( cublasHandle_t  handle,
int  n,
const float *  alpha,
const float *  x,
int  incx,
float *  y,
int  incy 
)

A template wrapper for cublasSaxpy.

Definition at line 135 of file cublas_interface.cu.

143  {
144  return cublasSaxpy(handle, n, alpha, x, incx, y, incy);
145  }
cublasStatus_t cublasSaxpy(cublasHandle_t handle, int n, const float *alpha, const float *x, int incx, float *y, int incy)
Definition of CUDA's cublasSaxpy function using dynamically loaded cublas library.

References cublasSaxpy().

Here is the call graph for this function:

◆ cublasXcopy()

template<typename DataType >
cublasStatus_t cublas_interface::cublasXcopy ( cublasHandle_t  handle,
int  n,
const DataType *  x,
int  incx,
DataType *  y,
int  incy 
)

Referenced by cuVectorOperations< DataType >::copy_scaled_vector(), and cuVectorOperations< DataType >::copy_vector().

Here is the caller graph for this function:

◆ cublasXcopy< double >()

template<>
cublasStatus_t cublas_interface::cublasXcopy< double > ( cublasHandle_t  handle,
int  n,
const double *  x,
int  incx,
double *  y,
int  incy 
)

A template wrapper for cublasDcopy.

Definition at line 115 of file cublas_interface.cu.

122  {
123  return cublasDcopy(handle, n, x, incx, y, incy);
124  }
cublasStatus_t cublasDcopy(cublasHandle_t handle, int n, const double *x, int incx, double *y, int incy)
Definition of CUDA's cublasDcopy function using dynamically loaded cublas library.

References cublasDcopy().

Here is the call graph for this function:

◆ cublasXcopy< float >()

template<>
cublasStatus_t cublas_interface::cublasXcopy< float > ( cublasHandle_t  handle,
int  n,
const float *  x,
int  incx,
float *  y,
int  incy 
)

A template wrapper for cublasScopy.

Definition at line 95 of file cublas_interface.cu.

102  {
103  return cublasScopy(handle, n, x, incx, y, incy);
104  }
cublasStatus_t cublasScopy(cublasHandle_t handle, int n, const float *x, int incx, float *y, int incy)
Definition of CUDA's cublasScopy function using dynamically loaded cublas library.

References cublasScopy().

Here is the call graph for this function:

◆ cublasXdot()

template<typename DataType >
cublasStatus_t cublas_interface::cublasXdot ( cublasHandle_t  handle,
int  n,
const DataType *  x,
int  incx,
const DataType *  y,
int  incy,
DataType *  result 
)

Referenced by cuVectorOperations< DataType >::inner_product().

Here is the caller graph for this function:

◆ cublasXdot< double >()

template<>
cublasStatus_t cublas_interface::cublasXdot< double > ( cublasHandle_t  handle,
int  n,
const double *  x,
int  incx,
const double *  y,
int  incy,
double *  result 
)

A template wrapper for cublasDdot.

Definition at line 198 of file cublas_interface.cu.

206  {
207  return cublasDdot(handle, n, x, incx, y, incy, result);
208  }
cublasStatus_t cublasDdot(cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result)
Definition of CUDA's cublasDdot function using dynamically loaded cublas library.

References cublasDdot().

Here is the call graph for this function:

◆ cublasXdot< float >()

template<>
cublasStatus_t cublas_interface::cublasXdot< float > ( cublasHandle_t  handle,
int  n,
const float *  x,
int  incx,
const float *  y,
int  incy,
float *  result 
)

A template wrapper for cublasSdot.

Definition at line 177 of file cublas_interface.cu.

185  {
186  return cublasSdot(handle, n, x, incx, y, incy, result);
187  }
cublasStatus_t cublasSdot(cublasHandle_t handle, int n, const float *x, int incx, const float *y, int incy, float *result)
Definition of CUDA's cublasSdot function using dynamically loaded cublas library.

References cublasSdot().

Here is the call graph for this function:

◆ cublasXgemv()

template<typename DataType >
cublasStatus_t cublas_interface::cublasXgemv ( cublasHandle_t  handle,
cublasOperation_t  trans,
int  m,
int  n,
const DataType *  alpha,
const DataType *  A,
int  lda,
const DataType *  x,
int  incx,
const DataType *  beta,
DataType *  y,
int  incy 
)

◆ cublasXgemv< double >()

template<>
cublasStatus_t cublas_interface::cublasXgemv< double > ( cublasHandle_t  handle,
cublasOperation_t  trans,
int  m,
int  n,
const double *  alpha,
const double *  A,
int  lda,
const double *  x,
int  incx,
const double *  beta,
double *  y,
int  incy 
)

A template wrapper for cublasDgemv.

Definition at line 67 of file cublas_interface.cu.

80  {
81  return cublasDgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta,
82  y, incy);
83  }

◆ cublasXgemv< float >()

template<>
cublasStatus_t cublas_interface::cublasXgemv< float > ( cublasHandle_t  handle,
cublasOperation_t  trans,
int  m,
int  n,
const float *  alpha,
const float *  A,
int  lda,
const float *  x,
int  incx,
const float *  beta,
float *  y,
int  incy 
)

A template wrapper for cublasSgemv.

Definition at line 40 of file cublas_interface.cu.

53  {
54  return cublasSgemv(handle, trans, m, n, alpha, A, lda, x, incx, beta,
55  y, incy);
56  }

◆ cublasXnrm2()

template<typename DataType >
cublasStatus_t cublas_interface::cublasXnrm2 ( cublasHandle_t  handle,
int  n,
const DataType *  x,
int  incx,
DataType *  result 
)

Referenced by cuVectorOperations< DataType >::euclidean_norm().

Here is the caller graph for this function:

◆ cublasXnrm2< double >()

template<>
cublasStatus_t cublas_interface::cublasXnrm2< double > ( cublasHandle_t  handle,
int  n,
const double *  x,
int  incx,
double *  result 
)

A template wrapper to cublasDnrm2.

Definition at line 238 of file cublas_interface.cu.

244  {
245  return cublasDnrm2(handle, n, x, incx, result);
246  }
cublasStatus_t cublasDnrm2(cublasHandle_t handle, int n, const double *x, int incx, double *result)
Definition of CUDA's cublasDnrm2 function using dynamically loaded cublas library.

References cublasDnrm2().

Here is the call graph for this function:

◆ cublasXnrm2< float >()

template<>
cublasStatus_t cublas_interface::cublasXnrm2< float > ( cublasHandle_t  handle,
int  n,
const float *  x,
int  incx,
float *  result 
)

A template wrapper to cublasSnrm2.

Definition at line 219 of file cublas_interface.cu.

225  {
226  return cublasSnrm2(handle, n, x, incx, result);
227  }
cublasStatus_t cublasSnrm2(cublasHandle_t handle, int n, const float *x, int incx, float *result)
Definition of CUDA's cublasSnrm2 function using dynamically loaded cublas library.

References cublasSnrm2().

Here is the call graph for this function:

◆ cublasXscal()

template<typename DataType >
cublasStatus_t cublas_interface::cublasXscal ( cublasHandle_t  handle,
int  n,
const DataType *  alpha,
DataType *  x,
int  incx 
)

◆ cublasXscal< double >()

template<>
cublasStatus_t cublas_interface::cublasXscal< double > ( cublasHandle_t  handle,
int  n,
const double *  alpha,
double *  x,
int  incx 
)

A template wrapper for cublasDscal.

Definition at line 276 of file cublas_interface.cu.

282  {
283  return cublasDscal(handle, n, alpha, x, incx);
284  }
cublasStatus_t cublasDscal(cublasHandle_t handle, int n, const double *alpha, double *x, int incx)
Definition of CUDA's cublasDscal function using dynamically loaded cublas library.

References cublasDscal().

Here is the call graph for this function:

◆ cublasXscal< float >()

template<>
cublasStatus_t cublas_interface::cublasXscal< float > ( cublasHandle_t  handle,
int  n,
const float *  alpha,
float *  x,
int  incx 
)

A template wrapper for cublasSscal.

Definition at line 257 of file cublas_interface.cu.

263  {
264  return cublasSscal(handle, n, alpha, x, incx);
265  }
cublasStatus_t cublasSscal(cublasHandle_t handle, int n, const float *alpha, float *x, int incx)
Definition of CUDA's cublasSscal function using dynamically loaded cublas library.

References cublasSscal().

Here is the call graph for this function: