]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp.{c,fortran}/interop-{hip,cuda}: Fix dg-run target selection
authorTobias Burnus <tburnus@baylibre.com>
Fri, 9 May 2025 08:57:44 +0000 (10:57 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Mon, 19 May 2025 07:49:41 +0000 (09:49 +0200)
commit6f607c9174ea8cc257b5d2f82fe1fe1e26ddbbf2
tree1e1e3b29b6cee185779e78c8e5c95dbe8f01dcea
parent24edffe147a7e550821e482498ef18719368255b
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.

(cherry picked from commit 94e63410474a36655e1800387eabd73a6f930048)
libgomp/testsuite/libgomp.c/interop-cuda-full.c
libgomp/testsuite/libgomp.c/interop-cuda-libonly.c
libgomp/testsuite/libgomp.c/interop-hip-amd-full.c
libgomp/testsuite/libgomp.c/interop-hip-amd-no-hip-header.c
libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c
libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-headers.c
libgomp/testsuite/libgomp.c/interop-hip-nvidia-no-hip-header.c
libgomp/testsuite/libgomp.fortran/interop-hip-amd-full.F90
libgomp/testsuite/libgomp.fortran/interop-hip-amd-no-module.F90
libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-full.F90
libgomp/testsuite/libgomp.fortran/interop-hip-nvidia-no-module.F90