Skip to content

Commit

Permalink
Fix seg fault by moving deleting dense vec descriptors to symbolic an…
Browse files Browse the repository at this point in the history
…d solve
  • Loading branch information
vqd8a committed Nov 15, 2022
1 parent 0c0a8c6 commit cb8b19e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,6 @@ class SPTRSVHandle {
pBuffer = nullptr;
}
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroySpMat(matDescr));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(vecBDescr));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(vecBDescr_dummy));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(vecXDescr));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(vecXDescr_dummy));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseSpSV_destroyDescr(spsvDescr));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroy(handle));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ void sptrsvcuSPARSE_symbolic(KernelHandle* sptrsv_handle,
h->handle, h->transpose, &alpha, h->matDescr, h->vecBDescr_dummy,
h->vecXDescr_dummy, cudaValueType, CUSPARSE_SPSV_ALG_DEFAULT,
h->spsvDescr, h->pBuffer));

//Destroy dummy dense vector descriptors
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(h->vecBDescr_dummy));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(h->vecXDescr_dummy));
}
#else // CUDA_VERSION < 11030
typedef typename KernelHandle::nnz_lno_t idx_type;
Expand Down Expand Up @@ -361,6 +365,10 @@ void sptrsvcuSPARSE_solve(KernelHandle* sptrsv_handle,
KOKKOS_CUSPARSE_SAFE_CALL(cusparseSpSV_solve(
h->handle, h->transpose, &alpha, h->matDescr, h->vecBDescr,
h->vecXDescr, cudaValueType, CUSPARSE_SPSV_ALG_DEFAULT, h->spsvDescr));

//Destroy dense vector descriptors
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(h->vecBDescr));
KOKKOS_CUSPARSE_SAFE_CALL(cusparseDestroyDnVec(h->vecXDescr));
}
#else // CUDA_VERSION < 11030
typedef typename KernelHandle::nnz_lno_t idx_type;
Expand Down

0 comments on commit cb8b19e

Please sign in to comment.