Skip to content

feat(hipfft): bind the Xt and Mp API in a hipfftxt module beside hipfft - #17

Merged
amontoison merged 2 commits into
mainfrom
users/amontoison/hipfftxt-module
Nov 7, 2026
Merged

amontoison merged 2 commits into
mainfrom
users/amontoison/hipfftxt-module

Conversation

@amontoison

@amontoison amontoison commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Why

CUDA Fortran splits cuFFT into two modules, cufft and cufftXt (the latter includes cufft and, since NVHPC 22.5, the cuFFTMp interfaces). For use cufftXt to hipify to a module of its own, the hipFFT binding follows the same split.

What

Two modules, as CUDA Fortran's cufft and cufftXt:

  • hipfft: the hipfft* functions of hipfft.h.
  • hipfftxt (new, src/hipfftxt): every hipfftXt* and hipfftMp* function, as in CUDA Fortran's cufftXt (so hipfftXtSetWorkArea too, although hipfft.h declares it), with the enums, constants and types of hipfftXt.h, hipfftMp.h and hiplibxt.h. It uses hipfft whole, so use hipfftxt alone gives the whole API, as #include <hipfft/hipfftXt.h> does in C. Fortran is case-insensitive, so use hipfftXt works too.
  • hipfftw: unchanged.

The Xt and Mp tables move from metadata/hipfft.toml to metadata/hipfftxt.toml.

Generator changes:

  • New [library] uses key: the modules a library uses whole, and so re-exports. Their enums, constants and types are not redeclared.
  • New [library] function_prefixes and skip_function_prefixes keys: the functions go by name, whatever header declares them. hipfftxt takes hipfftXt* and hipfftMp*; hipfft skips them. own_headers still 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), that ulibxt uses ulib without redeclaring it, and that a program using only ulibxt compiles. Also header_sources cases for hipfftxt. 612 tests pass, gen_sh.sh passes, and check_mods.sh compiles the three hipFFT modules.

Regenerated binding: ROCm/rocm-libraries#12367.

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.
@amontoison
amontoison requested a review from a team as a code owner November 7, 2026 07:57
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View 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.
@amontoison amontoison changed the title feat(hipfft): one module per hipFFT header, hipfftxt beside hipfft feat(hipfft): bind the Xt and Mp API in a hipfftxt module beside hipfft Nov 7, 2026
@amontoison
amontoison merged commit 68420b6 into main Nov 7, 2026
14 checks passed
@amontoison
amontoison deleted the users/amontoison/hipfftxt-module branch November 7, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants