Add hipSPARSE checklist tests: coo2csr, gthr/sctr, gemvi, csrsv2/csrilu02 (#411) - #485
Merged
Merged
Conversation
Compresses a COO row-index array into CSR row pointers and checks the offsets against the known result. Inverse of the existing Xcsr2coo test. Part of the hipSPARSE checklist (ROCm#411).
gthr gathers a dense vector's entries at a sparse index set into a packed vector; sctr scatters a packed vector back into a dense vector. Each test checks the packed/dense result element by element against the known values. Part of the hipSPARSE checklist (ROCm#411).
gemvi multiplies a dense matrix by a sparse vector: y = alpha*A*x + beta*y. Each test builds a dense host reference (alpha*matmul(A, x_dense) + beta*y) and checks the device result against it. Part of the hipSPARSE checklist (ROCm#411).
Both routines use the multi-stage legacy API (bufferSize -> analysis -> solve/compute) with a mat descriptor and an info object. csrsv2 solves a lower-triangular system L*x = alpha*f, checking the recovered x against a known solution used to build the RHS. csrilu02 factorizes a tridiagonal matrix (no fill-in, so ILU(0) equals exact LU) and checks the overwritten CSR values against host-computed LU factors. Part of the hipSPARSE checklist (ROCm#411).
Ozone-Whiskey
marked this pull request as ready for review
August 7, 2026 22:24
amontoison
approved these changes
Aug 7, 2026
amontoison
left a comment
Collaborator
There was a problem hiding this comment.
If all tests passed, we can merge the PR.
Thanks! 👍
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 remaining hipSPARSE routine groups from the #411 checklist that were
not covered by the earlier hipSPARSE test PR (#480). Four groups, s/d/c/z where
applicable, in both the Fortran 2003 and Fortran 2008 binding tiers — 42 new
test programs.
Xcoo2csr?gthr/?sctr{S,D,C,Z}gthr,{S,D,C,Z}sctr?gemvi{S,D,C,Z}gemvi(+_bufferSize)?csrilu02/?csrsv2{S,D,C,Z}csrilu02,{S,D,C,Z}csrsv2One commit per group.
Verification approach
Every test is self-verifying against a fixed small problem:
[0,0,1,2,2]back to CSR row pointers[0,2,3,5](inverse of the existing Xcsr2coo test).y = alpha*A*x + beta*yfor a denseAand sparsex, checked against a dense host reference (alpha*matmul(A, x_dense) + beta*y).L*x = alpha*f, where the RHSfis built from a known solution so the recoveredxcan be compared directly.The multi-stage csrsv2/csrilu02 routines exercise the full legacy pattern
(
bufferSize → analysis → solve/compute) with a matrix descriptor and an infoobject; no binding bugs surfaced in this group.
Notes
.f08extension (per the Add rocSOLVER checklist tests (gels, syevj/heevj, gesvdj, gebrd, orgqr/ungqr, ormqr/unmqr) #466/Add hipSOLVER checklist tests (geqrf, orgqr/ungqr, potrs, syevj, gesvdj) #468 convention).type(c_ptr); the f2008 tests use the array overloads for the data arrays where the generator provides them, matching the existing hipSPARSE tests.Test plan
ctest -R hipsparsegreen (76/76), no regressionsHIPFORT_USE_FPOINTER_INTERFACES=OFF