Skip to content

Commit

Permalink
fallback to our spmv when single strided vector
Browse files Browse the repository at this point in the history
cusparse SpMM has the issue when SM >= 70 and nvcc >= 11.6
  • Loading branch information
yhmtsai committed Apr 13, 2023
1 parent 914def9 commit eaa2196
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 eaa2196

Please sign in to comment.