Repository navigation
feat(hipfft): bind the Xt and Mp API in a hipfftxt module beside hipfft - #17
Merged
Merged
Conversation
CUDA Fortran ships cufft and cufftXt, the latter including cufft and the cuFFTMp interfaces, so `use cufftXt` should hipify to a module of its own. The hipfft module now holds hipfft.h only, and the new hipfftxt module hipfftXt.h, hipfftMp.h and the descriptor types of hiplibxt.h. hipfftxt `use`s hipfft whole, so `use hipfftxt` alone gives the whole API, as including hipfftXt.h does in C. The new [library] uses key names the modules a library uses whole: their functions, enums, constants and types are not redeclared, and they are re-exported. With it, own_headers also selects the functions. --explain picks, among libraries sharing a prefix, the one whose headers declare the function.
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
amontoison
added a commit
to amontoison/rocm-libraries
that referenced
this pull request
Nov 7, 2026
…modules One module per C header, as CUDA Fortran's cufft and cufftXt, so that `use cufftXt` hipifies to `use hipfftxt`: hipfft holds hipfft.h, and hipfftxt holds hipfftXt.h and hipfftMp.h. hipfftxt uses hipfft, so `use hipfftxt` alone gives the whole API. Both build into libhipfft_fortran.a (hip::hipfft_fortran), and the Xt and Mp metadata moves to metadata/hipfftxt.toml. Regenerated with ROCm/rocm-fortran-generator#17.
CUDA Fortran's cufftXt module has cufftXtSetWorkArea, but hipFFT declares hipfftXtSetWorkArea in hipfft.h, so splitting by header left it in hipfft. The functions now go by name: the new [library] function_prefixes key keeps only the functions with those prefixes, whatever header declares them, and skip_function_prefixes drops those another library binds. hipfftxt takes hipfftXt* and hipfftMp*, hipfft skips them; own_headers still decides the enums, constants and types.
amontoison
added a commit
to amontoison/rocm-libraries
that referenced
this pull request
Nov 7, 2026
Every hipfftXt* and hipfftMp* function is now in hipfftxt, as cufftXtSetWorkArea is in CUDA Fortran's cufftXt module, although hipfft.h declares hipfftXtSetWorkArea. Regenerated with ROCm/rocm-fortran-generator#17.
This was referenced Nov 7, 2026
Abuudiii
approved these changes
Nov 7, 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.
Why
CUDA Fortran splits cuFFT into two modules,
cufftandcufftXt(the latter includescufftand, since NVHPC 22.5, the cuFFTMp interfaces). Foruse cufftXtto hipify to a module of its own, the hipFFT binding follows the same split.What
Two modules, as CUDA Fortran's
cufftandcufftXt:hipfft: thehipfft*functions ofhipfft.h.hipfftxt(new,src/hipfftxt): everyhipfftXt*andhipfftMp*function, as in CUDA Fortran'scufftXt(sohipfftXtSetWorkAreatoo, althoughhipfft.hdeclares it), with the enums, constants and types ofhipfftXt.h,hipfftMp.handhiplibxt.h. Ituseshipfftwhole, souse hipfftxtalone gives the whole API, as#include <hipfft/hipfftXt.h>does in C. Fortran is case-insensitive, souse hipfftXtworks too.hipfftw: unchanged.The Xt and Mp tables move from
metadata/hipfft.tomltometadata/hipfftxt.toml.Generator changes:
[library] useskey: the modules a libraryuses whole, and so re-exports. Their enums, constants and types are not redeclared.[library] function_prefixesandskip_function_prefixeskeys: the functions go by name, whatever header declares them.hipfftxttakeshipfftXt*andhipfftMp*;hipfftskips them.own_headersstill decides the enums, constants and types.--explain: when several libraries share a prefix (hipfft,hipfftxt), it picks the one that binds the function.Tests: a
uses/fixture (a base header and an Xt header) checks that the functions go by prefix (one Xt function declared in the base header goes to the Xt module), thatulibxtusesulibwithout redeclaring it, and that a program using onlyulibxtcompiles. Alsoheader_sourcescases forhipfftxt. 612 tests pass,gen_sh.shpasses, andcheck_mods.shcompiles the three hipFFT modules.Regenerated binding: ROCm/rocm-libraries#12367.