QMCPACK
cuBLAS.hpp File Reference
+ Include dependency graph for cuBLAS.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 qmcplusplus
 helper functions for EinsplineSetBuilder
 
 qmcplusplus::cuBLAS
 interface to cuBLAS calls for different data types S/C/D/Z
 

Macros

#define castNativeType   castCUDAType
 
#define cublasErrorCheck(ans, cause)
 

Functions

void cublasAssert (cublasStatus_t code, const std::string &cause, const char *file, int line, bool abort=true)
 prints cuBLAS error messages. Always use cublasErrorCheck macro. More...
 
cublasOperation_t convertOperation (const char trans)
 
cublasStatus_t geam (cublasHandle_t &handle, cublasOperation_t &transa, cublasOperation_t &transb, int m, int n, const float *alpha, const float *A, int lda, const float *beta, const float *B, int ldb, float *C, int ldc)
 
cublasStatus_t geam (cublasHandle_t &handle, cublasOperation_t transa, cublasOperation_t transb, int m, int n, const double *alpha, const double *A, int lda, const double *beta, const double *B, int ldb, double *C, int ldc)
 
cublasStatus_t geam (cublasHandle_t &handle, cublasOperation_t transa, cublasOperation_t transb, int m, int n, const std::complex< double > *alpha, const std::complex< double > *A, int lda, const std::complex< double > *beta, const std::complex< double > *B, int ldb, std::complex< double > *C, int ldc)
 
cublasStatus_t geam (cublasHandle_t &handle, cublasOperation_t transa, cublasOperation_t transb, int m, int n, const std::complex< float > *alpha, const std::complex< float > *A, int lda, const std::complex< float > *beta, const std::complex< float > *B, int ldb, std::complex< float > *C, int ldc)
 
cublasStatus_t getrf_batched (cublasHandle_t &handle, int n, float *A[], int lda, int *PivotArray, int *infoArray, int batchSize)
 
cublasStatus_t getrf_batched (cublasHandle_t &handle, int n, double *A[], int lda, int *PivotArray, int *infoArray, int batchSize)
 
cublasStatus_t getrf_batched (cublasHandle_t &handle, int n, std::complex< float > *A[], int lda, int *PivotArray, int *infoArray, int batchSize)
 
cublasStatus_t getrf_batched (cublasHandle_t &handle, int n, std::complex< double > *A[], int lda, int *PivotArray, int *infoArray, int batchSize)
 
cublasStatus_t getri_batched (cublasHandle_t &handle, int n, float *A[], int lda, int *PivotArray, float *C[], int ldc, int *infoArray, int batchSize)
 
cublasStatus_t getri_batched (cublasHandle_t &handle, int n, double *A[], int lda, int *PivotArray, double *C[], int ldc, int *infoArray, int batchSize)
 
cublasStatus_t getri_batched (cublasHandle_t &handle, int n, std::complex< float > *A[], int lda, int *PivotArray, std::complex< float > *C[], int ldc, int *infoArray, int batchSize)
 
cublasStatus_t getri_batched (cublasHandle_t &handle, int n, std::complex< double > *A[], int lda, int *PivotArray, std::complex< double > *C[], int ldc, int *infoArray, int batchSize)
 

Macro Definition Documentation

◆ castNativeType

#define castNativeType   castCUDAType

Definition at line 23 of file cuBLAS.hpp.

Referenced by qmcplusplus::cuBLAS::geam().

◆ cublasErrorCheck

Function Documentation

◆ cublasAssert()

void cublasAssert ( cublasStatus_t  code,
const std::string &  cause,
const char *  file,
int  line,
bool  abort = true 
)
inline

prints cuBLAS error messages. Always use cublasErrorCheck macro.

Definition at line 40 of file cuBLAS.hpp.

References CUBLAS_STATUS_ALLOC_FAILED, CUBLAS_STATUS_ARCH_MISMATCH, CUBLAS_STATUS_EXECUTION_FAILED, CUBLAS_STATUS_INTERNAL_ERROR, CUBLAS_STATUS_INVALID_VALUE, CUBLAS_STATUS_MAPPING_ERROR, CUBLAS_STATUS_NOT_INITIALIZED, CUBLAS_STATUS_NOT_SUPPORTED, and CUBLAS_STATUS_SUCCESS.

41 {
42  if (code != CUBLAS_STATUS_SUCCESS)
43  {
44  std::string cublas_error;
45  switch (code)
46  {
48  cublas_error = "CUBLAS_STATUS_NOT_INITIALIZED";
49  break;
51  cublas_error = "CUBLAS_STATUS_ALLOC_FAILED";
52  break;
54  cublas_error = "CUBLAS_STATUS_INVALID_VALUE";
55  break;
57  cublas_error = "CUBLAS_STATUS_ARCH_MISMATCH";
58  break;
60  cublas_error = "CUBLAS_STATUS_MAPPING_ERROR";
61  break;
63  cublas_error = "CUBLAS_STATUS_EXECUTION_FAILED";
64  break;
66  cublas_error = "CUBLAS_STATUS_INTERNAL_ERROR";
67  break;
69  cublas_error = "CUBLAS_STATUS_NOT_SUPPORTED";
70  break;
71 #ifndef QMC_CUDA2HIP
72  case CUBLAS_STATUS_LICENSE_ERROR:
73  cublas_error = "CUBLAS_STATUS_LICENSE_ERROR";
74  break;
75 #endif
76  default:
77  cublas_error = "<unknown>";
78  }
79 
80  std::ostringstream err;
81  err << "cublasAssert: " << cublas_error << ", file " << file << " , line " << line << std::endl
82  << cause << std::endl;
83  std::cerr << err.str();
84  //if (abort) exit(code);
85  throw std::runtime_error(cause);
86  }
87 }
#define CUBLAS_STATUS_INVALID_VALUE
Definition: cuda2hip.h:26
#define CUBLAS_STATUS_ALLOC_FAILED
Definition: cuda2hip.h:22
#define CUBLAS_STATUS_SUCCESS
Definition: cuda2hip.h:31
#define CUBLAS_STATUS_EXECUTION_FAILED
Definition: cuda2hip.h:24
#define CUBLAS_STATUS_MAPPING_ERROR
Definition: cuda2hip.h:28
#define CUBLAS_STATUS_NOT_SUPPORTED
Definition: cuda2hip.h:30
#define CUBLAS_STATUS_NOT_INITIALIZED
Definition: cuda2hip.h:29
#define CUBLAS_STATUS_INTERNAL_ERROR
Definition: cuda2hip.h:25
#define CUBLAS_STATUS_ARCH_MISMATCH
Definition: cuda2hip.h:23