Skip to content

[ONEMKL_SYCL][REF] Add operation_info_t and matrix_opt to more cases and add two examples to cover it#70

Open
spencerpatty wants to merge 3 commits intomainfrom
dev/spatty/add_inspect_onemkl_sycl
Open

[ONEMKL_SYCL][REF] Add operation_info_t and matrix_opt to more cases and add two examples to cover it#70
spencerpatty wants to merge 3 commits intomainfrom
dev/spatty/add_inspect_onemkl_sycl

Conversation

@spencerpatty
Copy link
Copy Markdown
Contributor

@spencerpatty spencerpatty commented Mar 27, 2026

Summary:
1. add spmm_csr and sptrsv_csr examples with more complete API usage models (using operation_info_t and inspect functions)
2. add xyz_inspect and operation_info_t, and matrix_opt to ONEMKL_SYCL backend
3. add several more variants of reference function with more complete set of apis

Merge Checklist:

  • Passing CI
  • Update documentation or README.md
  • Additional Test/example added (if applicable) and passing
  • At least one reviewer approval
  • (optional) Clang sanitizer scan run and triaged
  • Clang formatter applied (verified as part of passing CI)

… introduce xyz_inspect for many cases, also add two new examples which uses them
@spencerpatty spencerpatty self-assigned this Mar 27, 2026
@spencerpatty spencerpatty added the enhancement New feature or request label Mar 27, 2026
Comment on lines +43 to +47
#if defined(__INTEL_MKL__) && \
((__INTEL_MKL__ == 2025) && (__INTEL_MKL_MINOR__ == 3) || \
(__INTEL_MKL__ > 2025))
m.size(), // nnz added in 2025.3, and without deprecated
#endif
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MKL SYCL api change in 2025.3 adding nnz to csr/csc/bsr and adding coo format which already had nnz in definition.

Comment on lines +146 to +152
info.update_impl_(tmp_info.result_shape(), tmp_info.result_nnz());
info.state_.a_handle = tmp_info.state_.a_handle;
info.state_.b_handle = tmp_info.state_.b_handle;
info.state_.c_handle = tmp_info.state_.c_handle;
info.state_.descr = tmp_info.state_.descr;
info.state_.c_rowptr = tmp_info.state_.c_rowptr;
info.state_.q = tmp_info.state_.q;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe could utilize a copy constructor here ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should info_t be copyable?

Co-authored-by: Spencer Patty <spencer.patty@intel.com>
Copy link
Copy Markdown
Contributor

@yhmtsai yhmtsai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some nit. Others lgtm.

add_example(simple_sptrsv)
add_example(spmm_csc)
add_example(matrix_opt_example)
if (ENABLE_ONEMKL_SYCL OR SPBLAS_REFERENCE_BACKEND )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (ENABLE_ONEMKL_SYCL OR SPBLAS_REFERENCE_BACKEND )
if (ENABLE_ONEMKL_SYCL OR SPBLAS_REFERENCE_BACKEND)

nit

Comment on lines +54 to +58
triangular_solve_inspect(a_opt, spblas::upper_triangle_t{},
spblas::implicit_unit_diagonal_t{}, b_scaled, x);

triangular_solve(a_opt, spblas::upper_triangle_t{},
spblas::implicit_unit_diagonal_t{}, b_scaled, x);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we would like to change it. Is this PR to add operation_info_t and matrix_opt only? When we introduce the descriptor, then switch to that?

"######################");
fmt::print("\n\t### Running Advanced SpMM Example:");
fmt::print("\n\t###");
fmt::print("\n\t### Y = alpha * A * X");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt::print("\n\t### Y = alpha * A * X");

auto&& [idx, a_v] = e;
auto&& [i, k] = idx;
for (std::size_t j = 0; j < __backend::shape(b)[1]; j++) {
for (std::size_t j = 0; j < __backend::shape(b)[1]; j++) { // b_row
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (std::size_t j = 0; j < __backend::shape(b)[1]; j++) { // b_row
for (std::size_t j = 0; j < __backend::shape(b)[1]; j++) {

maybe not needed? or move it to before for?

Comment on lines +146 to +152
info.update_impl_(tmp_info.result_shape(), tmp_info.result_nnz());
info.state_.a_handle = tmp_info.state_.a_handle;
info.state_.b_handle = tmp_info.state_.b_handle;
info.state_.c_handle = tmp_info.state_.c_handle;
info.state_.descr = tmp_info.state_.descr;
info.state_.c_rowptr = tmp_info.state_.c_rowptr;
info.state_.q = tmp_info.state_.q;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should info_t be copyable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants