| 726 | } |
| 727 | |
| 728 | ~DeviceSpMatCOO() { |
| 729 | CHECK_CUDA( cudaSetDevice(this->gpu_id) ); |
| 730 | if (this->col_ids != nullptr) { |
| 731 | CHECK_CUDA( cudaFree(this->col_ids) ); |
| 732 | this->col_ids = nullptr; |
| 733 | } |
| 734 | if (this->row_ids != nullptr) { |
| 735 | CHECK_CUDA( cudaFree(this->row_ids) ); |
| 736 | this->row_ids = nullptr; |
| 737 | } |
| 738 | if (this->vals != nullptr) { |
| 739 | CHECK_CUDA( cudaFree(this->vals) ); |
| 740 | this->vals = nullptr; |
| 741 | } |
| 742 | if (this->cusparse_descr != NULL) { |
| 743 | CHECK_CUSPARSE( cusparseDestroySpMat(this->cusparse_descr) ); |
| 744 | this->cusparse_descr = NULL; |
| 745 | } |
| 746 | // std::cout << "DeviceSpMatDoubleCSC destructor called!" << std::endl; |
| 747 | } |
| 748 | }; |
| 749 | |
| 750 |
nothing calls this directly
no outgoing calls
no test coverage detected