Repository navigation
Update the classification of the arguments, and cover the query routines - #571
Merged
Merged
Conversation
0422854 reclassified rocsparse_spildlt0_buffer_size's p_buffer_size_in_bytes from type(c_ptr),value to a bare integer(c_size_t), so the two callers now pass bufSize directly instead of c_loc(bufSize); the target attribute goes with it. These were the only call sites in the test tree affected by that commit.
0422854 reclassified the output scalars of ~110 query routines from type(c_ptr),value to real Fortran scalars, and almost none of them had any test: only two call sites in the whole tree were even affected by the change. Add 20 tests (f2003 + f2008) exercising the version, pointer-mode, handle-state and descriptor getters across rocblas, rocsolver, rocsparse, hipblas, hipsolver, hipsparse, hipfft, hiprand and rocrand. Each test passes the reclassified outputs directly rather than through c_loc, and poisons every output variable with a sentinel before the call, so a binding that fails to write through the reference is caught instead of silently passing. Where a round-trip is possible the exact value set is required back; the descriptor getters are checked against the values the descriptor was built with, using distinct m/n and a one-based index base so neither is trivially a default. Two assertions are deliberately weaker, with the reason stated inline: rocblas_set_math_mode(xf32) reports success but is only honoured on gfx94x, so the mode is checked to be a valid member of the enum rather than round-tripped; and the hipsolverRfSet* entry points return NOT_SUPPORTED on ROCm, so hipsolver_rf_params queries the documented defaults instead. Verified on gfx1101 with ROCm 10.2.
amontoison
added a commit
that referenced
this pull request
Oct 6, 2026
The symbol tests were last regenerated before #553, #564, #571, #572 and 5de6093, so they no longer matched the bindings: eight of them failed to compile with -DHIPFORT_EXTENDED_TESTS=ON, passing type(c_ptr) to arguments those changes typed (hipblasGetProperty_, hipsolver *gels niters, the hipSPARSE/rocSPARSE descriptor getters, rocfft_cache_serialize, the hipFFTW guru dims, ...). Regenerated with gen_symbol_tests.jl from rocm-fortran main, against the bindings on develop. Besides the signature fixes, the tests now reference the routines added by the ROCm 10.1 regeneration (rocsolver cholqr and larft_64, rocblas gemm_grouped_batched, ...). Most of the remaining churn is the scratch variables being renumbered around the new types. Built with gfortran against ROCm 10.1 with -DHIPFORT_EXTENDED_TESTS=ON: all 13 symbol tests compile, link and pass, and the full ctest run shows only the three known WSL failures (hip_mem_advise f2003/f2008, hip_module_kernel).
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.
Follow-up to #564 and #569.
Bindings
Reclassifies the output arguments of ~110 query routines across hipSOLVER, hipSPARSE, rocBLAS, rocSOLVER and rocSPARSE. Arguments the C API writes through a pointer were declared
type(c_ptr),value, which forced callers to wrap them inc_loc(...)and gave up every bit of type checking. They are now declared as the Fortran scalars they actually are:integer(c_int) :: version,integer(c_size_t) :: bufferSize,real(c_double) :: zerointeger(kind(SOME_ENUM)) :: modefor the enum-valued gettersCallers pass the variable directly. A few modules gained
use hipfort_enumsfor theHIP_R_32Fdatatype kind.Tests
Only two call sites in the whole test tree were affected by the signature change (
rocsparse_spildlt0_buffer_size, f2003 + f2008) — because almost none of these query routines had any test at all. That is the gap the second commit fills: 20 tests x 2 dialects covering the version, pointer-mode, handle-state and descriptor getters of rocBLAS, rocSOLVER, rocSPARSE, hipBLAS, hipSOLVER, hipSPARSE, hipFFT, hipRAND and rocRAND.Each test poisons every output variable with a sentinel before the call, so a binding that fails to write through the reference fails the test instead of silently passing. Where a round-trip is possible the exact value set is required back; the descriptor getters are checked against the values the descriptor was built with, using distinct
m/nand a one-based index base so neither is trivially a default.Two assertions are deliberately weaker, with the reason stated inline in the source:
rocblas_set_math_mode(xf32)reports success but is only honoured on gfx94x, so the mode is checked to be a valid member of the enum rather than round-tripped.hipsolverRfSet*entry points returnNOT_SUPPORTEDon ROCm, sohipsolver_rf_paramsqueries the documented defaults instead.