diff options
author | Tobias Burnus <tburnus@baylibre.com> | 2025-05-09 10:57:44 +0200 |
---|---|---|
committer | Tobias Burnus <tburnus@baylibre.com> | 2025-05-09 10:57:44 +0200 |
commit | 94e63410474a36655e1800387eabd73a6f930048 (patch) | |
tree | 7592315482e123bf14dc61dd964b57631c4bbd97 /libgomp/testsuite/libgomp.fortran | |
parent | cc74e2f2b39b6debbef1787a087abad2108e95dd (diff) | |
download | gcc-94e63410474a36655e1800387eabd73a6f930048.zip gcc-94e63410474a36655e1800387eabd73a6f930048.tar.gz gcc-94e63410474a36655e1800387eabd73a6f930048.tar.bz2 |
libgomp.{c,fortran}/interop-{hip,cuda}: Fix dg-run target selection
While the tests checked whether the CUDA/HIP runtime is available
before processing them, the execution was then done unconditionally,
leading to FAIL when the default device was the host (or the wrong
offload device).
Now the test is only executed ('run') when the default device is an
Nvidia or AMD GPU (depending on the test case, cf. the test file name).
Otherwise, only a 'link' test is done. (Except when the effective-target
check cannot find the runtime lib - then the test is skipped [as before].)
Note: The cublas/hipblas tests use variant functions and iterate over
all devices, such that the cublas or hipblas, respectively, is only
called when the active device is an AMD or Nvidia device, respectively,
while for the host and other device types the fallback is called.
libgomp/ChangeLog:
* testsuite/libgomp.c/interop-cuda-full.c: Use 'link' instead
of 'run' when the default device is "! offload_device_nvptx".
* testsuite/libgomp.c/interop-cuda-libonly.c: Likewise.
* testsuite/libgomp.c/interop-hip-nvidia-full.c: Likewise.
* testsuite/libgomp.c/interop-hip-nvidia-no-headers.c: Likewise.
* testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c: Likewise.
* testsuite/libgomp.fortran/interop-hip-nvidia-full.F90: Likewise.
* testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90: Likewise.
* testsuite/libgomp.c/interop-hip-amd-full.c: Use 'link' instead
of 'run' when the default device is "! offload_device_gcn".
* testsuite/libgomp.c/interop-hip-amd-no-hip-header.c: Likewise.
* testsuite/libgomp.fortran/interop-hip-amd-full.F90: Likewise.
* testsuite/libgomp.fortran/interop-hip-amd-no-module.F90: Likewise.
Diffstat (limited to 'libgomp/testsuite/libgomp.fortran')
4 files changed, 12 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 index bbd49dd..eb2f437 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_gcn } } } +! { dg-do link { target { ! offload_device_gcn } } } + ! { dg-require-effective-target gomp_hipfort_module } ! { dg-require-effective-target gomp_libamdhip64 } ! { dg-additional-options "-lamdhip64" } diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 index 0afec83..0ebbe80 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_gcn } } } +! { dg-do link { target { ! offload_device_gcn } } } + ! { dg-require-effective-target gomp_libamdhip64 } ! { dg-additional-options "-lamdhip64" } diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 index cef592f..d29a689 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_nvptx } } } +! { dg-do link { target { ! offload_device_nvptx } } } + ! { dg-require-effective-target gomp_hipfort_module } ! { dg-require-effective-target openacc_cudart } ! { dg-require-effective-target openacc_cuda } diff --git a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 index c1ef29d..2063610 100644 --- a/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 +++ b/libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90 @@ -1,3 +1,6 @@ +! { dg-do run { target { offload_device_nvptx } } } +! { dg-do link { target { ! offload_device_nvptx } } } + ! { dg-require-effective-target openacc_libcudart } ! { dg-require-effective-target openacc_libcuda } ! { dg-additional-options "-lcuda -lcudart" } |