Skip to content

Add hipSPARSE checklist tests: coo2csr, gthr/sctr, gemvi, csrsv2/csrilu02 (#411) - #485

Merged
amontoison merged 4 commits into
ROCm:developfrom
Ozone-Whiskey:hipsparse-411-tests
Aug 7, 2026
Merged

Add hipSPARSE checklist tests: coo2csr, gthr/sctr, gemvi, csrsv2/csrilu02 (#411)#485
amontoison merged 4 commits into
ROCm:developfrom
Ozone-Whiskey:hipsparse-411-tests

Conversation

@Ozone-Whiskey

Copy link
Copy Markdown
Collaborator

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
.

Checklist group Routines Files
Xcoo2csr index-only (COO rows → CSR row pointers) 2
?gthr / ?sctr {S,D,C,Z}gthr, {S,D,C,Z}sctr 16
?gemvi {S,D,C,Z}gemvi (+ _bufferSize) 8
?csrilu02 / ?csrsv2 {S,D,C,Z}csrilu02, {S,D,C,Z}csrsv2 16

One commit per group.

Verification approach

Every test is self-verifying against a fixed small problem:

  • Xcoo2csr: compresses [0,0,1,2,2] back to CSR row pointers [0,2,3,5] (inverse of the existing Xcsr2coo test).
  • gthr / sctr: gather/scatter a dense vector at a sparse index set; every packed/dense element is checked against the known values.
  • gemvi: y = alpha*A*x + beta*y for a dense A and sparse x, checked against a dense host reference (alpha*matmul(A, x_dense) + beta*y).
  • csrsv2: lower-triangular solve L*x = alpha*f, where the RHS f is built from a known solution so the recovered x can be compared directly.
  • csrilu02: ILU(0) of a tridiagonal matrix — no fill-in, so ILU(0) equals the exact LU factorization; the overwritten CSR values are checked against the host-computed LU factors.

The multi-stage csrsv2/csrilu02 routines exercise the full legacy pattern
(bufferSize → analysis → solve/compute) with a matrix descriptor and an info
object; no binding bugs surfaced in this group.

Notes

Test plan

  • All 42 new tests build and PASS on gfx90a (MI210), ROCm 7.1.0, gfortran 13.3, both tiers
  • Full ctest -R hipsparse green (76/76), no regressions
  • f2003 tests also compile with HIPFORT_USE_FPOINTER_INTERFACES=OFF

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
Ozone-Whiskey marked this pull request as ready for review August 7, 2026 22:24

@amontoison amontoison left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If all tests passed, we can merge the PR.
Thanks! 👍

@amontoison amontoison added the testing Issue describing testing needs or current testing infrastructure deficiencies label Aug 7, 2026
@amontoison
amontoison merged commit 5ed2a4c into ROCm:develop Aug 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Issue describing testing needs or current testing infrastructure deficiencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants