| 644 | } |
| 645 | |
| 646 | ~DeviceSpMatCSR() { |
| 647 | CHECK_CUDA( cudaSetDevice(this->gpu_id) ); |
| 648 | if (this->col_ids != nullptr) { |
| 649 | CHECK_CUDA( cudaFree(this->col_ids) ); |
| 650 | this->col_ids = nullptr; |
| 651 | } |
| 652 | if (this->row_ptrs != nullptr) { |
| 653 | CHECK_CUDA( cudaFree(this->row_ptrs) ); |
| 654 | this->row_ptrs = nullptr; |
| 655 | } |
| 656 | if (this->vals != nullptr) { |
| 657 | CHECK_CUDA( cudaFree(this->vals) ); |
| 658 | this->vals = nullptr; |
| 659 | } |
| 660 | if (this->cusparse_descr != NULL) { |
| 661 | CHECK_CUSPARSE( cusparseDestroySpMat(this->cusparse_descr) ); |
| 662 | this->cusparse_descr = NULL; |
| 663 | } |
| 664 | // std::cout << "DeviceSpMatDoubleCSC destructor called!" << std::endl; |
| 665 | } |
| 666 | }; |
| 667 | |
| 668 | //sparse matrix wrapper on device: COO format |
nothing calls this directly
no outgoing calls
no test coverage detected