]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp: Add additional OpenMP interop runtime tests
authorTobias Burnus <tburnus@baylibre.com>
Thu, 24 Apr 2025 12:36:37 +0000 (14:36 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 24 Apr 2025 13:28:52 +0000 (15:28 +0200)
commitb28645de4e50367c5f8b68b0b5664e0b7da000b7
tree09b4d9e35c08951b9b7f8f9179ec8c871b93b83a
parentd28dcc50cebc6dc7e751b29352da28718de80036
libgomp: Add additional OpenMP interop runtime tests

Add checks for nowait/depend and for checks that the returned
CUDA, CUDA_DRIVER and HIP interop objects actually work.

While the CUDA/CUDA_DRIVER ones are only for Nvidia GPUs, HIP
works on both AMD and Nvidia GPUs; on Nvidia GPUs, it is a
very thin wrapper around CUDA.

For Fortran, only a HIP test has been added - using hipfort.

While libgomp.c-c++-common/interop-2.c always works - even without
GPU - and checks for depend / nowait, all others require that
runtime libraries are found at link (and execution) time:
For Nvidia GPUs, libcuda + libcudart or libcublas,
For AMD GPUs, libamdhip64 or libhipblas.

The header files and hipfort modules do not need to be present as a
fallback has been implemented, but if they are, they get used.

Due to the combinations, the basic 1x C/C++, 4x C and 1x Fortran tests
yield 1x C/C++, 14x C and 4 Fortran run-test files.

libgomp/ChangeLog:

* testsuite/lib/libgomp.exp (check_effective_target_openacc_cublas,
check_effective_target_openacc_cudart): Update description as
the check requires more.
(check_effective_target_openacc_libcuda,
check_effective_target_openacc_libcublas,
check_effective_target_openacc_libcudart,
check_effective_target_gomp_hip_header_amd,
check_effective_target_gomp_hip_header_nvidia,
check_effective_target_gomp_hipfort_module,
check_effective_target_gomp_libamdhip64,
check_effective_target_gomp_libhipblas): New.
* testsuite/libgomp.c-c++-common/interop-2.c: New test.
* testsuite/libgomp.c/interop-cublas-full.c: New test.
* testsuite/libgomp.c/interop-cublas-libonly.c: New test.
* testsuite/libgomp.c/interop-cuda-full.c: New test.
* testsuite/libgomp.c/interop-cuda-libonly.c: New test.
* testsuite/libgomp.c/interop-hip-amd-full.c: New test.
* testsuite/libgomp.c/interop-hip-amd-no-hip-header.c: New test.
* testsuite/libgomp.c/interop-hip-nvidia-full.c: New test.
* testsuite/libgomp.c/interop-hip-nvidia-no-headers.c: New test.
* testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c: New test.
* testsuite/libgomp.c/interop-hip.h: New test.
* testsuite/libgomp.c/interop-hipblas-amd-full.c: New test.
* testsuite/libgomp.c/interop-hipblas-amd-no-hip-header.c: New test.
* testsuite/libgomp.c/interop-hipblas-nvidia-full.c: New test.
* testsuite/libgomp.c/interop-hipblas-nvidia-no-headers.c: New test.
* testsuite/libgomp.c/interop-hipblas-nvidia-no-hip-header.c: New test.
* testsuite/libgomp.c/interop-hipblas.h: New test.
* testsuite/libgomp.fortran/interop-hip-amd-full.F90: New test.
* testsuite/libgomp.fortran/interop-hip-amd-no-module.F90: New test.
* testsuite/libgomp.fortran/interop-hip-nvidia-full.F90: New test.
* testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90: New test.
* testsuite/libgomp.fortran/interop-hip.h: New test.

(cherry picked from commit 515d9be7944e89f5ec4363f9816ad4031ab6394b)
24 files changed:
libgomp/ChangeLog.omp
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp.c-c++-common/interop-2.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-cublas-full.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-cublas-libonly.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-cuda-full.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-cuda-libonly.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hip-amd-full.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hip-amd-no-hip-header.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-headers.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hip.h [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hipblas-amd-full.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hipblas-amd-no-hip-header.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hipblas-nvidia-full.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hipblas-nvidia-no-headers.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hipblas-nvidia-no-hip-header.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/interop-hipblas.h [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 [new file with mode: 0644]
libgomp/testsuite/libgomp.fortran/interop-hip.h [new file with mode: 0644]