Repository navigation
feat(rocfft): add the generated Fortran binding in bindings/fortran/rocfft - #12366
Draft
amontoison wants to merge 8 commits into
Draft
amontoison wants to merge 8 commits into
amontoison wants to merge 8 commits into
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #12366 +/- ##
===========================================
+ Coverage 75.95% 75.98% +0.03%
===========================================
Files 2880 2880
Lines 479025 479016 -9
Branches 71958 71953 -5
===========================================
+ Hits 363828 363952 +124
+ Misses 90338 90126 -212
- Partials 24859 24938 +79
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
This was referenced Sep 24, 2026
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
from
September 25, 2026 04:37
f2a3a9c to
f0038a7
Compare
This was referenced Sep 25, 2026
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
2 times, most recently
from
September 28, 2026 03:49
08ad616 to
db76704
Compare
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
from
September 29, 2026 03:14
db76704 to
397c344
Compare
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
from
October 4, 2026 03:45
d345993 to
e3bd7b1
Compare
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
from
October 5, 2026 05:13
e3bd7b1 to
45b431e
Compare
Add fortran/rocfft.F90, the rocfft module generated from the C headers by the rocm-fortran generator under RFC0019 (ROCm/TheRock#8122). It is committed next to the headers, is not edited by hand, and .gitattributes marks it linguist-generated.
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
from
October 22, 2026 13:23
45b431e to
bb8f4fc
Compare
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
2 times, most recently
from
October 22, 2026 15:33
77e8328 to
41d4fef
Compare
Build fortran/rocfft.F90 as roc::rocfft_fortran from fortran/, a CMake
project of its own that the root adds. BUILD_FORTRAN_BINDINGS (default
${UNIX}), BUILD_FORTRAN_CLIENTS (default ON) and
FORTRAN_ARRAY_INTERFACES (default assumed-shape) control it, and
ROCFFT_BUILD_FORTRAN_* override per library. The .mod and the archive
install per compiler under <includedir>/fortran/<compiler> and
<libdir>/fortran/<compiler>, beside a rocfft-fortran config package.
fortran/test/ adds 18 CTest tests labelled gpu; they use hip and skip
until ROCm/rocm-systems#11923 lands. rocFFT had no Fortran module
before, so nothing is removed.
Refs: ROCm/TheRock#8122 (RFC0019)
amontoison
force-pushed
the
users/amontoison/rocfft-fortran-bindings
branch
from
October 22, 2026 18:14
41d4fef to
22b04f8
Compare
The rocFFT Fortran binding consumes rocFFT's public API and builds standalone against an installed rocFFT, so it moves out of the library into bindings/fortran/rocfft, the tree every monorepo and TheRock use for the Fortran bindings (RFC0015). Nothing is wired into the library build any more: the library is back to its state on develop. - bindings/fortran/rocfft reads rocFFT's version from projects/rocfft - the binding has its own .gitattributes and CHANGELOG.md - CODEOWNERS: /bindings/fortran/rocfft/, same owners - repos-config.json: register bindings/fortran/rocfft so CI detects changes
Regenerate bindings/fortran/rocfft with rocm-fortran-generator 9c8b3e4, and commit its metadata in bindings/fortran/rocfft/metadata/, where the generator reads it from a checkout, instead of the copy kept in the generator.
Install the test executables in bin/, and a CTestTestfile.cmake in bin/rocfft-fortran/ with the same tests and properties as the build tree, so that ctest --test-dir runs them from an install, as TheRock's test jobs do for the libraries.
The binding is built against an installed rocFFT and is never added to the library's build, so drop what only served that: the per-library BUILD_FORTRAN_* overrides, the PARENT_SCOPE results, the ROCM_HAVE_FORTRAN shortcut, the gating on the library's client and test options, and the comments about the root. Find the Fortran compiler through the cmake/ROCmFortranCompiler.cmake shared by all the bindings, and require CMake 3.19.
…ortran The package files went to lib/cmake/rocfft, the C library's directory, with a forwarder in lib/cmake/rocfft-fortran. rocRAND and hipRAND install their own legacy <lib>-fortran-config.cmake there, so the files overlapped. Install the config, targets and version files directly where find_package(<package>) looks, as the HIP and ROCTx bindings do, and drop the forwarder.
… recursion rocm-cmake's generated rocfft-config.cmake is to include lib/cmake/rocfft-fortran/rocfft-fortran-config.cmake after its targets (ROCm/rocm-cmake#303). Skip find_dependency(rocfft) when rocfft is the package being found, not only when roc::rocfft is already imported, so that include never re-enters rocfft-config.cmake.
This branch has not been deployed
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.
Implements RFC0015, Fortran Bindings Split (update) for rocFFT:
bindings/fortran/rocfft/is a standalone CMake project that builds the generated Fortran binding against an installed rocFFT. The library is untouched: no option, noadd_subdirectory, no change toprojects/rocfft/.What lands
bindings/fortran/rocfft/rocfft.F90(721 lines, generated with ROCm/rocm-fortran-generator 9c8b3e4 from the rocFFT headers, markedlinguist-generated): one modulerocfftwith thebind(C)interfaces, the enum constants, therocfftCheckhelper and array overloads; plans, descriptions, execution info, fields and bricks are plaintype(c_ptr).metadata/rocfft.toml: the generator metadata it was generated with.test/: 36 CTest tests, 18.f03tests of the C interfaces and 18.f08tests of the array overloads (registered as<name>_f2008).rocfft_field_brick_zand its_f2008variant skip (return code 77) on fewer than two GPUs. They also install: the executables inbin/, and aCTestTestfile.cmakewith the same tests and properties inbin/rocfft-fortran/, forctest --test-dir.CMakeLists.txt, therocfft-fortranconfig template,cmake/ROCmFortranCompiler.cmake(the same in every binding: ROCm'samdflangis preferred over the first compiler onPATHunlessCMAKE_Fortran_COMPILERorFCis set),cmake/toolchains/and the binding'sCHANGELOG.md..github/CODEOWNERS:/bindings/fortran/rocfft/ @ROCm/rocm-fortran-maintainers @ROCm/fft-reviewers..github/repos-config.json: abindings/fortranentry, so CI detects changes to the binding. Each binding PR appends its entry at the end of the list, so all but the first to merge need a trivial rebase.A consumer uses
find_package(rocfft-fortran)and linksroc::rocfft_fortran. The archive and.modfiles install per compiler underlib/fortran/<compiler>/andinclude/fortran/<compiler>/;ROCFFT_FORTRAN_COMPILER_DIRnames that directory. The archive has one section per procedure, so a program linked with-Wl,--gc-sectionskeeps only the wrappers it calls.Options
BUILD_FORTRAN_BINDINGS${UNIX}BUILD_FORTRAN_CLIENTSONtest/; off underBUILD_ADDRESS_SANITIZERFORTRAN_ARRAY_INTERFACESassumed-shapenone/assumed-shape/assumed-rankarray overloadsIn TheRock
ROCm/TheRock#9446 builds
bindings/fortran/rocfftas therocfft-fortransubproject against the rocFFT it built, with-DBUILD_FORTRAN_BINDINGS=ON -DBUILD_FORTRAN_CLIENTS=${THEROCK_BUILD_TESTING}, ships it in thefft-fortranartifact and runs the installed tests in itsrocfft-fortranGPU test job.Follow-ups
rocFFT never shipped a Fortran module, so there is nothing to deprecate.
Build and test
From the repository root, with
$PREFIXthe install prefix:$HIP_FORTRAN_PREFIXholds the HIP Fortran binding (hip-fortran) built with the same compiler; without it the tests are skipped.Verification
Standalone against ROCm 10.1 with amdflang on one GPU: 36 tests, 34 pass, 2 skipped.
JIRA ID: ROCM-31390