gunrock / graphblast

High-Performance Linear Algebra-based Graph Primitives on GPUs
Apache License 2.0
209 stars 27 forks source link

Fix cmake bug and double free error #25

Closed ctcyang closed 3 years ago

ctcyang commented 3 years ago

Fixes Issue #11 and CMakeLists.txt build issue for triangle counting.

Fixed by using member variable {csr,csc}initialized in SparseMatrix to keep track of which data structure has been initialized and is up-to-date. This means that when GRB_SPARSE_MATRIX_FORMAT is set to CSRCSC and we've done an SpGEMM to compute C's CSR representation, we'll need to note that C'S CSC representation is out of date by marking cscinitialized = false while csrinitialized = true.

Similarly, we'll have {csr,csc}ownership in SparseMatrix for the variant of SparseMatrix::build that takes in raw GPU pointers. This is used to indicate to the destructor we don't have ownership and we shouldn't try to free.