Skip to content

Commit

Permalink
Workaround for cuda 12 issue in cusparse (#1508)
Browse files Browse the repository at this point in the history
Authors:
  - Corey J. Nolet (https://github.com/cjnolet)
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Divye Gala (https://github.com/divyegala)
  - Ben Frederickson (https://github.com/benfred)

URL: #1508
  • Loading branch information
cjnolet authored May 11, 2023
1 parent 1d1c523 commit 2e73bda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cpp/include/raft/spectral/detail/matrix_wrappers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ struct sparse_matrix_t {
cusparseDnVecDescr_t vecX;
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsecreatednvec(&vecX, size_x, x));

rmm::device_uvector<value_type> y_tmp(size_y, stream);
raft::copy(y_tmp.data(), y, size_y, stream);

cusparseDnVecDescr_t vecY;
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsecreatednvec(&vecY, size_y, y));
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsecreatednvec(&vecY, size_y, y_tmp.data()));

// get (scratch) external device buffer size:
//
Expand All @@ -241,6 +244,8 @@ struct sparse_matrix_t {
RAFT_CUSPARSE_TRY(raft::sparse::detail::cusparsespmv(
cusparse_h, trans, &alpha, matA, vecX, &beta, vecY, spmv_alg, external_buffer.raw(), stream));

// FIXME: This is a workaround for a cusparse issue being encountered in CUDA 12
raft::copy(y, y_tmp.data(), size_y, stream);
// free descriptors:
//(TODO: maybe wrap them in a RAII struct?)
//
Expand Down

0 comments on commit 2e73bda

Please sign in to comment.