Repository navigation
More typed forms, and the fixes a per-library audit found - #584
Merged
Merged
Conversation
Regenerated with rocm-fortran 3b65cdb. Typed forms for scalar pointers that still needed c_loc(): the BLAS dot/nrm2/asum/iamax/iamin results and rotg/rotmg scalars (rocBLAS and hipBLAS) and hipBLAS rot's c/s; the sparse doti/dotci results, nnz counts, pivot positions and csr2ell_width's ell_width; hipBLAS getrs/geqrf/gels info (host); hipChooseDevice. The array overloads take the BLAS results and hipBLAS info typed and gain _rank_N_devptr twins that keep the type(c_ptr), so existing c_loc() calls still compile. Fixes: - rocSOLVER larf/larfg alpha/tau are device scalars and lose their _typed form, which would have handed the kernel a host address; - hipsolverRfBatchZeroPivot position (an array) and rocblas_set_solution_fitness_query fitness (a retained pointer) lose theirs too; - csrcolor's coloring/reordering are arrays again in the array overloads; - rocSPARSE's nullable `error` arguments are optional; - hipMalloc(..., source=) and its siblings report an allocation failure instead of the copy's status; - the compat hipsolver*gels/gesvd_bufferSize are no longer bound to cusolverDn symbols with different arguments under USE_CUDA_NAMES; - hipChooseDevice is a generic over hipChooseDeviceR0600's specifics instead of a second interface on the same binding label. Three tests take a result through the new typed forms: rocBLAS ddot, hipBLAS snrm2 and rocSPARSE ddoti (host pointer mode). Also regenerates the supported-API tables (only the generated diff: the variants column gains typed and devptr), and updates the changelog with the Scalar arguments section and tests of #583, the typed forms above and the fixes.
amontoison
force-pushed
the
more_typed_forms
branch
from
October 7, 2026 14:45
8556f5a to
c194391
Compare
This was referenced Oct 9, 2026
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 #581 and #583, from a library-by-library audit of the bindings against the ROCm 10.1 headers. Regenerated with rocm-fortran 3b65cdb.
More typed forms
These scalar pointers still needed
c_loc(). They now also get a_typedform:dot/dotu/dotc/nrm2/asum/iamax/iaminresult;rotgandrotmgscalars;c/sof hipBLASrot.doti/dotciresults;*_nnz/*_nnzb/nnz_compress/csr2bsrNnz/csr2gebsrNnzroutines;csritsv_zero_pivotandcsric0/csrilu0_singular_pivot;ell_widthofcsr2ell_width.infoofgetrs/geqrf/gels, which the header documents as host memory.hipChooseDevice, whose metadata key named the short alias instead of thehipChooseDeviceR0600symbol, so the entry never applied;failIdxandnbGroupsoutputs.The array overloads take the BLAS results and the hipBLAS
infotyped. New_rank_N_devptrvariants keep thetype(c_ptr)these arguments always had there, so existingc_loc()calls still compile.Fixes
larf/larfg:alphaandtauare device scalars, since the library forces the device pointer mode. They lose the_typedform introduced by Bind every scalar pointer as type(c_ptr), add its typed form as _typed #581, which would have handed the kernel a host address.hipsolverRfBatchZeroPivotandrocblas_set_solution_fitness_querylose theirs too. The first one'spositionis an array ofbatchSizeints. The second one'sfitnessis a pointer the library keeps.csrcolor(rocSPARSE and hipSPARSE):coloringandreorderingare arrays again in the array overloads. The color count andfraction_to_colorare host scalars.errorarguments (spgeam,spmv_set_input,v2_spmv, ...) areoptional.hipMalloc(..., source=)and itshipMallocManaged/hipHostMallocsiblings: the copy used to overwrite the allocation's status. They now copy only after a successful allocation, so an out-of-memory is reported.USE_CUDA_NAMES: the compathipsolver?gesvd_bufferSize/??gels_bufferSizewere bound tocusolverDnroutines with different arguments. These were amdflang's 8-Wexternal-interface-mismatchwarnings, and the build now has none. They are ROCm-only now.hipChooseDeviceis a generic overhipChooseDeviceR0600's own specifics, instead of a second interface on the same binding label (F2018 19.2).Also in this PR
ddot, hipBLASsnrm2, and rocSPARSEddotiin host pointer mode;Validation
ROCm 10.1, gfortran and amdflang.
USE_ASSUMED_SHAPE,USE_ASSUMED_RANKandUSE_ASSUMED_SHAPE+USE_CUDA_NAMESdevelopwithUSE_CUDA_NAMES)developctestwith-DHIPFORT_EXTENDED_TESTS=ONhip_mem_advise×2,hip_module_kernel)libcudaNot in this PR
hipfftXt, hipFFTW array overloads, more.nativeroutines): after the release.