| 422 | } |
| 423 | |
| 424 | BaseGPUDevice::~BaseGPUDevice() { |
| 425 | delete gpu_device_info_; |
| 426 | for (auto sb : scratch_) gpu_allocator_->DeallocateRaw(sb); |
| 427 | for (auto ctx : device_contexts_) ctx->Unref(); |
| 428 | if (cuda_graph_cublas_workspace_ != nullptr) { |
| 429 | cudaError_t e_cu_free_cublas_worksapce = cudaFree(cuda_graph_cublas_workspace_); |
| 430 | if (e_cu_free_cublas_worksapce != cudaSuccess) { |
| 431 | LOG(ERROR) << std::string("free cuBLAS workspace failed ") |
| 432 | << cudaGetErrorString(e_cu_free_cublas_worksapce); |
| 433 | } |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | // This should be idempotent if already initialized. |
| 438 | Status BaseGPUDevice::InitScratchBuffers() { |
nothing calls this directly
no test coverage detected