MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / ~DeviceSpMatCSR

Method ~DeviceSpMatCSR

XM/include/Utils/memory.h:646–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected