Skip to content

Commit

Permalink
Merge Fix cusparse SpMM issue on single strided vector if SM>=70 and …
Browse files Browse the repository at this point in the history
…cuda>=11.6

This PR fallbacks to our spmv when cusparse SpMM on single strided vector if SM>=70 and cuda>=11.6

Related PR: #1322
  • Loading branch information
yhmtsai authored Apr 14, 2023
2 parents 914def9 + eaa2196 commit d63cb4e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cuda/matrix/csr_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ bool try_general_sparselib_spmv(std::shared_ptr<const CudaExecutor> exec,
cusparse::destroy(vecb);
cusparse::destroy(vecc);
} else {
#if CUDA_VERSION >= 11060
if (b->get_size()[1] == 1 && exec->get_major_version() >= 7) {
// cusparseSpMM seems to take the single strided vector as column
// major without considering stride and row major (SM >= 70 and
// cuda 11.6)
return false;
}
#endif // CUDA_VERSION >= 11060
cusparseSpMMAlg_t alg = CUSPARSE_SPMM_CSR_ALG2;
auto vecb =
cusparse::create_dnmat(b->get_size(), b->get_stride(), b_val);
Expand Down

0 comments on commit d63cb4e

Please sign in to comment.