Open
Conversation
yhmtsai
requested changes
Apr 10, 2026
Comment on lines
+47
to
+73
| // | ||
| // Takes in a CSR or CSR_transpose (aka CSC) or CSC or CSC_transpose | ||
| // and returns the transpose value associated with it being represented | ||
| // in the CSR format (since oneMKL SYCL currently does not have CSC | ||
| // format | ||
| // | ||
| // CSR = CSR + nontrans | ||
| // CSR_transpose = CSR + trans | ||
| // CSC = CSR + trans | ||
| // CSC_transpose -> CSR + nontrans | ||
| // | ||
| // template <matrix M> | ||
| // oneapi::mkl::transpose get_transpose(M&& m) { | ||
| // static_assert(__detail::has_csr_base<M> || __detail::has_csc_base<M>); | ||
|
|
||
| // const bool conjugate = __detail::is_conjugated(m); | ||
| // if constexpr (__detail::has_csr_base<M>) { | ||
| // if (conjugate) { | ||
| // throw std::runtime_error( | ||
| // "oneMKL SYCL backend does not support conjugation for CSR views."); | ||
| // } | ||
| // return oneapi::mkl::transpose::nontrans; | ||
| // } else if constexpr (__detail::has_csc_base<M>) { | ||
| // return conjugate ? oneapi::mkl::transpose::conjtrans | ||
| // : oneapi::mkl::transpose::trans; | ||
| // } | ||
| // } |
Contributor
There was a problem hiding this comment.
you can delete this for now
|
|
||
| template <matrix M> | ||
| requires __detail::is_csr_view_v<M> | ||
| cusparseSpMatDescr_t create_matrix_handle(M&& m) { |
Contributor
There was a problem hiding this comment.
I will keep the same naming scheme for matrix like create_matrix_descriptor.
|
|
||
| template <matrix M> | ||
| cusparseSpMatDescr_t | ||
| get_matrix_handle(M&& m, |
Contributor
There was a problem hiding this comment.
Suggested change
| get_matrix_handle(M&& m, | |
| get_matrix_descriptor(M&& m, |
Comment on lines
-59
to
+57
| state->set_b_descriptor(b_descr); | ||
| state->set_c_descriptor(c_descr); | ||
| auto b_handle = __cusparse::create_cusparse_handle(x_base); | ||
| auto c_handle = __cusparse::create_cusparse_handle(y); |
Contributor
There was a problem hiding this comment.
because it currently does not set it to state, you will also need to remove the corresponding part in state
| #ifdef SPBLAS_ENABLE_ONEMKL_SYCL | ||
| oneapi::mkl::sparse::matrix_handle_t matrix_handle_; | ||
| #elif SPBLAS_ENABLE_CUSPARSE | ||
| cusparseSpMatDescr_t matrix_handle_; |
Contributor
There was a problem hiding this comment.
Suggested change
| cusparseSpMatDescr_t matrix_handle_; | |
| cusparseSpMatDescr_t matrix_descriptor_; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Adds the following for the cuSPARSE backend:
matrix_handlefor CSR and CSC formats,SpMM, small updates toSpMV, draft ofSpGEMM.Details:
Since I wasn't able to test
SpGEMM, I expect it to have multiple issues.A simple case of
SpMMwas verified in the example file.Merge Checklist: