Skip to content

test(ci): build the Fortran bindings with ROCm/TheRock#9446 (do not merge) - #15008

Draft
amontoison wants to merge 142 commits into
ROCm:developfrom
amontoison:fortran/therock-pin-test
Draft

amontoison wants to merge 142 commits into
ROCm:developfrom
amontoison:fortran/therock-pin-test

Conversation

@amontoison

Copy link
Copy Markdown
Contributor

Test only, do not merge. This PR checks that ROCm/TheRock#9446 builds the Fortran bindings of rocm-libraries, which now live in bindings/fortran/<lib>/, outside the libraries.

The HIP binding is not in the rocm-systems commit TheRock pins, so the binding tests that use hip are skipped here; ROCm/rocm-systems#14097 tests the HIP and ROCTx bindings.

JIRA ID: ROCM-31390

Add fortran/rocblas.F90, the rocblas 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.
Add fortran/hipblas.F90, the hipblas 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.
Add fortran/rocsolver.F90, the rocsolver 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.
Add fortran/hipsolver.F90, the hipsolver 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.
Add fortran/hiprand.F90, the hiprand 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.
Add fortran/rocsparse.F90, the rocsparse 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.
Add fortran/hipsparse.F90, the hipsparse 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.
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.
Add fortran/hipfft.F90 and fortran/hipfftw.F90, the hipfft and hipfftw
modules generated from the C headers by the rocm-fortran generator
under RFC0019 (ROCm/TheRock#8122). They are committed next to the
headers, are not edited by hand, and .gitattributes marks them
linguist-generated.
Add fortran/rocrand.F90, the rocrand 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.
…ted one

Build fortran/rocblas.F90 as roc::rocblas_fortran from fortran/, a CMake
project of its own that the root adds. BUILD_FORTRAN_BINDINGS (default
${UNIX}) and FORTRAN_ARRAY_INTERFACES (default assumed-shape) control
it; the existing BUILD_FORTRAN_CLIENTS is forced OFF when no binding is
built. ROCBLAS_BUILD_FORTRAN_* override both per library. The .mod and
the archive install per compiler under <includedir>/fortran/<compiler>
and <libdir>/fortran/<compiler>, beside a rocblas-fortran config
package.

Remove library/include/rocblas_module.f90. Its rocblas_enums module is
folded into rocblas, so use rocblas_enums becomes use rocblas, and
rocblas_create_handle and rocblas_get_stream take their output by
reference. The clients shims and samples use the generated module, and
the trmm sample is fixed and built; there is no fortran/test suite.

Refs: ROCm/TheRock#8122 (RFC0019)
…ted one

Build fortran/hipblas.F90 as roc::hipblas_fortran from fortran/, a CMake
project of its own that the root adds. BUILD_FORTRAN_BINDINGS (default
${UNIX}, OFF on the CUDA backend) and FORTRAN_ARRAY_INTERFACES (default
assumed-shape) control it; the existing BUILD_FORTRAN_CLIENTS is forced
OFF when no binding is built. HIPBLAS_BUILD_FORTRAN_* override both per
library. The .mod and the archive install per compiler under
<includedir>/fortran/<compiler> and <libdir>/fortran/<compiler>, beside
a hipblas-fortran config package.

Remove library/src/hipblas_module.f90. Its hipblas_enums module is
folded into hipblas, so use hipblas_enums becomes use hipblas, and
hipblasCreate and the getters take their output by reference. The
clients shims and samples use the generated module; a client-only
hip_datatypes_stub.F90 stands in for the HIP binding until
ROCm/rocm-systems#11923 lands. There is no fortran/test suite.

Refs: ROCm/TheRock#8122 (RFC0019)
Build fortran/rocsolver.F90 as roc::rocsolver_fortran from fortran/, a
CMake project of its own that the root adds. BUILD_FORTRAN_BINDINGS
(default ${UNIX}) and BUILD_FORTRAN_CLIENTS (default ON) control it,
and ROCSOLVER_BUILD_FORTRAN_* override both per library;
FORTRAN_ARRAY_INTERFACES selects nothing here. The .mod and the archive
install per compiler under <includedir>/fortran/<compiler> and
<libdir>/fortran/<compiler>, beside a rocsolver-fortran config package.

The module uses rocblas, so it links roc::rocblas_fortran and needs the
rocBLAS binding built by the same compiler; without one it is skipped.
fortran/test/ adds 84 CTest tests labelled gpu. They use hip, so they
skip until ROCm/rocm-systems#11923 lands the HIP binding. rocSOLVER had
no Fortran module before, so nothing is removed.

Refs: ROCm/TheRock#8122 (RFC0019)
…rated one

Build fortran/hipsolver.F90 as roc::hipsolver_fortran from fortran/, a
CMake project of its own that the root adds. BUILD_FORTRAN_BINDINGS
(default ${UNIX}, OFF on the CUDA backend) and BUILD_FORTRAN_CLIENTS
(default ON) control it, and HIPSOLVER_BUILD_FORTRAN_* override both per
library; FORTRAN_ARRAY_INTERFACES selects nothing here. The .mod and the
archive install per compiler under <includedir>/fortran/<compiler> and
<libdir>/fortran/<compiler>, beside a hipsolver-fortran config package.

Remove library/src/hipsolver_module.f90, deprecated since hipSOLVER
2.3.0, and EXPORT_FORTRAN_BINDINGS. Its hipsolver_enums module is folded
into hipsolver, so use hipsolver_enums becomes use hipsolver, and
outputs are passed by reference. fortran/test/ adds 51 CTest tests
labelled gpu; they use hip and skip until ROCm/rocm-systems#11923 lands.

Refs: ROCm/TheRock#8122 (RFC0019)
…bindings are missing

A standalone clients build with BUILD_FORTRAN_BINDINGS=ON (the default on
Linux) stopped with a FATAL_ERROR when hipsolver-fortran was not installed
for the Fortran compiler in use. Build the clients without the Fortran
tests and say so in a STATUS line, as every other project does when the
bindings are unavailable.
…rated one

Build fortran/rocsparse.F90 as roc::rocsparse_fortran from fortran/, a
CMake project of its own that the root adds. BUILD_FORTRAN_BINDINGS
(default ${UNIX}, skipped under BUILD_ROCSPARSE_ILP64),
BUILD_FORTRAN_CLIENTS (default ON) and FORTRAN_ARRAY_INTERFACES (default
assumed-shape) control it, and ROCSPARSE_BUILD_FORTRAN_* override per
library. The .mod and the archive install per compiler under
<includedir>/fortran/<compiler> and <libdir>/fortran/<compiler>, beside
a rocsparse-fortran config package.

Remove library/src/rocsparse.f90 and rocsparse_enums.f90, so use
rocsparse_enums becomes use rocsparse; the CHANGELOG lists the calls
that change. The samples link roc::rocsparse_fortran. fortran/test/
adds 68 CTest tests labelled gpu; they use hip and skip until
ROCm/rocm-systems#11923 lands.

Refs: ROCm/TheRock#8122 (RFC0019)
…rated one

Build fortran/hipsparse.F90 as roc::hipsparse_fortran from fortran/, a
CMake project of its own that the root adds. BUILD_FORTRAN_BINDINGS
(default ${UNIX}, OFF on the CUDA backend), BUILD_FORTRAN_CLIENTS
(default ON) and FORTRAN_ARRAY_INTERFACES (default assumed-shape)
control it, and HIPSPARSE_BUILD_FORTRAN_* override per library.
The .mod and the archive install per compiler under
<includedir>/fortran/<compiler> and <libdir>/fortran/<compiler>, beside
a hipsparse-fortran config package.

Remove library/src/hipsparse.f90 and hipsparse_enums.f90, never
installed, so use hipsparse_enums becomes use hipsparse. The samples
link roc::hipsparse_fortran. fortran/test/ adds 52 CTest tests labelled
gpu; they use hip and skip until ROCm/rocm-systems#11923 lands.

Refs: ROCm/TheRock#8122 (RFC0019)
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)
Build fortran/hipfft.F90 and fortran/hipfftw.F90 as hip::hipfft_fortran
and hip::hipfftw_fortran from fortran/, a CMake project of its own that
the root adds. BUILD_FORTRAN_BINDINGS (default ${UNIX}, OFF on the CUDA
backend), BUILD_FORTRAN_CLIENTS (default ON) and
FORTRAN_ARRAY_INTERFACES (default assumed-shape, hipfft only) control
them, and HIPFFT_BUILD_FORTRAN_* and HIPFFTW_BUILD_FORTRAN_* override
per binding. The .mod files and the archives install per compiler under
<includedir>/fortran/<compiler> and <libdir>/fortran/<compiler>, beside
hipfft-fortran and hipfftw-fortran config packages.

fortran/test/ adds 20 CTest tests labelled gpu; they use hip and skip
until ROCm/rocm-systems#11923 lands. hipFFT had no Fortran module
before, so nothing is removed.

Refs: ROCm/TheRock#8122 (RFC0019)
Build fortran/rocrand.F90 as roc::rocrand_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
ROCRAND_BUILD_FORTRAN_* override per library. The .mod and the archive
install per compiler under <includedir>/fortran/<compiler> and
<libdir>/fortran/<compiler>, beside a rocrand-fortran config package.

Remove the rocrand_m wrapper, its HIP modules and BUILD_FORTRAN_WRAPPER,
deprecated since rocRAND 4.0.0, so use rocrand_m becomes use rocrand.
The FRUIT suite moves to fortran/test/, which adds 25 CTest tests; all
but the version query are labelled gpu, use hip, and skip until
ROCm/rocm-systems#11923 lands.

Refs: ROCm/TheRock#8122 (RFC0019)
Build fortran/hiprand.F90 as hip::hiprand_fortran from fortran/, a CMake
project of its own that the root adds. BUILD_FORTRAN_BINDINGS (default
${UNIX}, OFF on the CUDA backend), BUILD_FORTRAN_CLIENTS (default ON)
and FORTRAN_ARRAY_INTERFACES (default assumed-shape) control it, and
HIPRAND_BUILD_FORTRAN_* override per library. The .mod and the archive
install per compiler under <includedir>/fortran/<compiler> and
<libdir>/fortran/<compiler>, beside a hiprand-fortran config package.

Remove the hiprand_m wrapper, its HIP modules and BUILD_FORTRAN_WRAPPER,
deprecated since hipRAND 3.0.0, so use hiprand_m becomes use hiprand.
The FRUIT suite moves to fortran/test/, which adds 25 CTest tests; all
but the version query are labelled gpu, use hip, and skip until
ROCm/rocm-systems#11923 lands.

Refs: ROCm/TheRock#8122 (RFC0019)
Under BUILD_CODE_COVERAGE, hiprand publishes -Xarch_host
-fprofile-instr-generate as PUBLIC link options, so every consumer
inherits them. The Fortran version test links hip::hiprand with
amdflang, which rejects both, and broke the math-ci codecov build.
Apply them only to consumers whose linker language is not Fortran;
$<LINK_LANGUAGE> would need CMake 3.18 and hipRAND requires 3.16.
…sparse

The rocSPARSE Fortran binding consumes rocSPARSE's public API and builds
standalone against an installed rocSPARSE, so it moves out of the library
into bindings/fortran/rocsparse, 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, including its
hand-written Fortran module, whose deprecation and removal, with the
Fortran clients that use it, follow in separate pull requests.

- bindings/fortran/rocsparse reads rocSPARSE's version from projects/rocsparse
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/rocsparse/, same owners
- repos-config.json: register bindings/fortran/rocsparse so CI detects changes
The rocBLAS Fortran binding consumes rocBLAS's public API and builds
standalone against an installed rocBLAS, so it moves out of the library
into bindings/fortran/rocblas, 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. Its hand-written
Fortran module stays for now: its deprecation and removal, with the
Fortran clients that use it, follow in separate pull requests.

- bindings/fortran/rocblas reads rocBLAS's version from projects/rocblas
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/rocblas/, same owners
- repos-config.json: register bindings/fortran/rocblas so CI detects changes
The hipBLAS Fortran binding consumes hipBLAS's public API and builds
standalone against an installed hipBLAS, so it moves out of the library
into bindings/fortran/hipblas, 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. Its hand-written
Fortran module stays for now: its deprecation and removal, with the
Fortran clients that use it, follow in separate pull requests.

- bindings/fortran/hipblas reads hipBLAS's version from projects/hipblas
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/hipblas/, same owners
- repos-config.json: register bindings/fortran/hipblas so CI detects changes
…solver

The rocSOLVER Fortran binding consumes rocSOLVER's public API and builds
standalone against an installed rocSOLVER, so it moves out of the library
into bindings/fortran/rocsolver, 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/rocsolver reads rocSOLVER's version from projects/rocsolver
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/rocsolver/, same owners
- repos-config.json: register bindings/fortran/rocsolver so CI detects changes
…solver

The hipSOLVER Fortran binding consumes hipSOLVER's public API and builds
standalone against an installed hipSOLVER, so it moves out of the library
into bindings/fortran/hipsolver, 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. Its hand-written
Fortran module stays for now: its deprecation and removal, with the
Fortran clients that use it, follow in separate pull requests.

- bindings/fortran/hipsolver reads hipSOLVER's version from projects/hipsolver
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/hipsolver/, same owners
- repos-config.json: register bindings/fortran/hipsolver so CI detects changes
…sparse

The hipSPARSE Fortran binding consumes hipSPARSE's public API and builds
standalone against an installed hipSPARSE, so it moves out of the library
into bindings/fortran/hipsparse, 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. Its hand-written
Fortran module stays for now: its deprecation and removal, with the
Fortran clients that use it, follow in separate pull requests.

- bindings/fortran/hipsparse reads hipSPARSE's version from projects/hipsparse
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/hipsparse/, same owners
- repos-config.json: register bindings/fortran/hipsparse so CI detects changes
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
The hipRAND Fortran binding consumes hipRAND's public API and builds
standalone against an installed hipRAND, so it moves out of the library
into bindings/fortran/hiprand, 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. Its hand-written
Fortran module stays for now: its deprecation and removal, with the
Fortran clients that use it, follow in separate pull requests.

- bindings/fortran/hiprand reads hipRAND's version from projects/hiprand
- the binding has its own .gitattributes and CHANGELOG.md
- CODEOWNERS: /bindings/fortran/hiprand/, same owners
- repos-config.json: register bindings/fortran/hiprand so CI detects changes
…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.
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.
…-fortran

The package files went to lib/cmake/rocblas, the C library's directory, with a forwarder in lib/cmake/rocblas-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.
…-fortran

The package files went to lib/cmake/hipblas, the C library's directory, with a forwarder in lib/cmake/hipblas-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.
…lver-fortran

The package files went to lib/cmake/rocsolver, the C library's directory, with a forwarder in lib/cmake/rocsolver-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.
…lver-fortran

The package files went to lib/cmake/hipsolver, the C library's directory, with a forwarder in lib/cmake/hipsolver-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.
…arse-fortran

The package files went to lib/cmake/rocsparse, the C library's directory, with a forwarder in lib/cmake/rocsparse-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.
…arse-fortran

The package files went to lib/cmake/hipsparse, the C library's directory, with a forwarder in lib/cmake/hipsparse-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.
…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.
…ortran and lib/cmake/hipfftw-fortran

The package files went to lib/cmake/hipfft, the C library's directory, with a forwarder in lib/cmake/hipfft-fortran and lib/cmake/hipfftw-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.
…-fortran

The package files went to lib/cmake/rocrand, the C library's directory, with a forwarder in lib/cmake/rocrand-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.
…-fortran

The package files went to lib/cmake/hiprand, the C library's directory, with a forwarder in lib/cmake/hiprand-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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant