| 223 | #endif // CUDA_VERSION >= 9000 |
| 224 | |
| 225 | bool CUDABlas::Init() { |
| 226 | gpu::ScopedActivateExecutorContext sac{parent_}; |
| 227 | cublasStatus_t ret = cublasCreate(&blas_); |
| 228 | if (ret != CUBLAS_STATUS_SUCCESS) { |
| 229 | LOG(ERROR) << "failed to create cublas handle: " << ToString(ret); |
| 230 | return false; |
| 231 | } |
| 232 | |
| 233 | #if CUDA_VERSION >= 11000 |
| 234 | ret = cublasLtCreate(&blasLt_); |
| 235 | if (ret != CUBLAS_STATUS_SUCCESS) { |
| 236 | LOG(ERROR) << "failed to create cublasLt handle: " << ToString(ret); |
| 237 | return false; |
| 238 | } |
| 239 | LOG(INFO) << "Create cuBLASLt success."; |
| 240 | #endif // CUDA_VERSION >= 11000 |
| 241 | |
| 242 | return true; |
| 243 | } |
| 244 | |
| 245 | CUDABlas::CUDABlas(gpu::GpuExecutor* parent) |
| 246 | : parent_(CHECK_NOTNULL(parent)), |
no test coverage detected