Add hipSPARSE tests (csrgemm, sptrsv, sptrsm, csr2csc, csr2coo) - #480
Merged
Merged
Conversation
Ozone-Whiskey
marked this pull request as ready for review
August 6, 2026 06:26
Ozone-Whiskey
marked this pull request as draft
August 6, 2026 06:26
Ozone-Whiskey
force-pushed
the
hipsparse-checklist-tests
branch
from
August 6, 2026 07:12
b99cdf0 to
f951734
Compare
Ozone-Whiskey
marked this pull request as ready for review
August 6, 2026 07:15
Collaborator
Author
|
Resolved merge conflicts |
amontoison
approved these changes
Aug 6, 2026
amontoison
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 👍
Did you forget to push the tests for csr2coo?
2 tasks
Collaborator
Author
|
PR is up for csr2coo. There was a conflict with new bindings generated in develop and it before. |
3 tasks
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
Seeds hipSPARSE test coverage (previously zero hipSPARSE tests existed) for the roc/hipSPARSE top-routine list, recycling the merged rocSPARSE tests. s/d/c/z where applicable, in both the Fortran 2003 and Fortran 2008 binding tiers.
Routines covered (17 total, f2003 + f2008 each = 34 new test programs):
ScsrgemmDcsrgemmCcsrgemmZcsrgemmSsptrsvDsptrsvCsptrsvZsptrsv(generic SpSV)SsptrsmDsptrsmCsptrsmZsptrsm(generic SpSM)Scsr2cscDcsr2cscCcsr2cscZcsr2cscXcsr2coo(index-only)Each routine is one commit (f2003 + f2008 pair + CMake registration).
File extensions (.f08)
Per review feedback on #466/#468, files in
test/f2008/use the.f08extension so CMake selects the Fortran 2008 standard. The sharedhipfort_add_testhelper is updated to prefer.f08and fall back to.f03, so existing.f03f2008 tests keep building.Verification approach
Every test is self-verifying against a fixed small CSR matrix:
matmulreference).SpMV / SpMM intentionally excluded (binding bug)
SpMV/SpMMare not included. hipfort's generatedhipfort_hipsparse_enums.F90assigns wrong values to thehipsparseSpMVAlg_t/hipsparseSpMMAlg_talgorithm enums: the C headers define these as a single enum with duplicate values (theSPMV_*/SPMM_*families restart at 0, reusing the legacyMV_*/MM_*values), which a Fortranenum, bind(c)cannot represent — so the generator numbered them sequentially. For example the CHIPSPARSE_SPMV_ALG_DEFAULT = 0but hipfort emits4; passing it selects a COO algorithm on a CSR matrix and returnsHIPSPARSE_STATUS_INVALID_VALUE. The correct fix belongs in the generator (emit these as integer parameters with the real values, as it already does forHIPSPARSE_SPMV_CSR_ALG3). rocSPARSE already covers SpMV/SpMM, so no coverage is lost here.Notes
type(c_ptr)-only (no array overloads), so the f2008 tests pass device pointers viac_loc(...), matching the rocSPARSE generic tests.Test plan