15 #include "cublas_v2.h" 29 case CUBLAS_STATUS_NOT_INITIALIZED:
30 return "CUBLAS_STATUS_NOT_INITIALIZED";
31 case CUBLAS_STATUS_ALLOC_FAILED:
32 return "CUBLAS_STATUS_ALLOC_FAILED";
33 case CUBLAS_STATUS_INVALID_VALUE:
34 return "CUBLAS_STATUS_INVALID_VALUE";
35 case CUBLAS_STATUS_ARCH_MISMATCH:
36 return "CUBLAS_STATUS_ARCH_MISMATCH";
37 case CUBLAS_STATUS_MAPPING_ERROR:
38 return "CUBLAS_STATUS_MAPPING_ERROR";
39 case CUBLAS_STATUS_EXECUTION_FAILED:
40 return "CUBLAS_STATUS_EXECUTION_FAILED";
41 case CUBLAS_STATUS_INTERNAL_ERROR:
42 return "CUBLAS_STATUS_INTERNAL_ERROR";
44 return "unknown CUBLAS error";
48 #define cublas_check(call) \ 51 if (status != CUBLAS_STATUS_SUCCESS) { \ 52 std::cerr << "CUDA error: " << etl::impl::cublas::cublas_str(status) << " from " << #call << std::endl \ 53 << "from " << __FILE__ << ":" << __LINE__ << std::endl; \ 67 cublasCreate(&handle);
86 cublasHandle_t
get() {
94 cublasDestroy(handle);
98 #ifndef ETL_CUBLAS_LOCAL_HANDLE cublas_handle & start_cublas()
Start cublas and return a RTTI helper over a raw cublas handle.
Definition: cublas.hpp:104
RTTI helper to manage CUBLAS handle.
Definition: cublas.hpp:60
cublas_handle(cublasHandle_t handle)
Construct the helper from the raw handle.
Definition: cublas.hpp:74
const char * cublas_str(cublasStatus_t code)
Returns the string representation of the given CUBLAS status code.
Definition: cublas.hpp:27
~cublas_handle()
Destruct the helper and release the raw cublas handle.
Definition: cublas.hpp:93
cublas_handle()
Construct the helper and create the handle directly.
Definition: cublas.hpp:66
cublasHandle_t handle
The raw cublas handle.
Definition: cublas.hpp:61