Skip to content

feat (sparse) : add support for the BSR sparse format - #1201

Draft
jalvesz wants to merge 35 commits into
fortran-lang:masterfrom
jalvesz:sparse_bsr
Draft

feat (sparse) : add support for the BSR sparse format#1201
jalvesz wants to merge 35 commits into
fortran-lang:masterfrom
jalvesz:sparse_bsr

Conversation

@jalvesz

@jalvesz jalvesz commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Draft PR to introduce the BSR (Block Sparse Row) matrix format. Similar to the CSR format but allowing dense NxM blocks per index entry in the sparse graph.

jalvesz and others added 30 commits January 16, 2026 23:49
- Add BSR_type to stdlib_sparse_kinds
- Add spmv_bsr implementation in new stdlib_sparse_spmv_bsr.fypp
- Register stdlib_sparse_spmv_bsr.fypp in CMakeLists.txt
- Add BLAS linkage to sparse target
- Update spmv interface with BSR subroutine declarations
- Update COO spmv to use do concurrent with entry_index naming
- Add BSR documentation to stdlib_sparse.md
- Add BSR tests to test_linalg_sparse.fypp

Rebased onto fortran-lang/stdlib master (0e45050)
# Conflicts:
#	src/sparse/stdlib_sparse_spmv_coo.fypp
#	src/sparse/stdlib_sparse_spmv_csc.fypp
#	src/sparse/stdlib_sparse_spmv_ell.fypp
feat(sparse): add BSR format and rebase sparse_bsr onto fortran-lang/stdlib master
* Initial plan

* Refactor stdlib_sparse_spmv_bsr: split OOP procedures into non-OOP kernels and thin wrappers

- Create spmv_bsr_1d_${s1}$_kernel and spmv_bsr_2d_${s1}$_kernel non-OOP subroutines
  containing the full computational logic for rank=1 and rank=2 BSR SpMV respectively
- Kernel signature: (data, rowptr, col, nrows, ncols, storage, block_shape, vec_x, vec_y, alpha, beta, op)
- Update spmv_bsr_1d_${s1}$ and spmv_bsr_2d_${s1}$ OOP module subroutines to thin wrappers
  that unpack matrix components and forward them to the corresponding kernel
- Eliminate all `associate` statements from OOP wrappers
- Preserve all existing numerical behavior: storage modes, ops, BLAS call semantics

* Apply remaining changes

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.20%. Comparing base (923f75f) to head (ed12bc8).
⚠️ Report is 100 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1201      +/-   ##
==========================================
- Coverage   68.68%   68.20%   -0.48%     
==========================================
  Files         407       19     -388     
  Lines       13612     2378   -11234     
  Branches     1537        0    -1537     
==========================================
- Hits         9349     1622    -7727     
+ Misses       4263      756    -3507     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants