]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp/testsuite: Fix hip_header_nvidia check, add workaround to test
authorTobias Burnus <tburnus@baylibre.com>
Thu, 24 Apr 2025 16:26:30 +0000 (18:26 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Thu, 24 Apr 2025 16:57:48 +0000 (18:57 +0200)
commitc9731fdbe4b323f563ee07b05a9a2ff153708aee
treeb53789a6707a5aedeabbaa726f101fb8d183ae98
parentb28645de4e50367c5f8b68b0b5664e0b7da000b7
libgomp/testsuite: Fix hip_header_nvidia check, add workaround to test

This is all about using the AMD's HIP header files with
__HIP_PLATFORM_NVIDIA__ defined, i.e. HIP with Nvidia/CUDA; in that case,
HIP is a thin layer on top of CUDA.

First, the check_effective_target_gomp_hip_header_nvidia check failed;
to fix it, -Wno-deprecated-declarations was added - and likewise to the
two affected testcases that actually used the HIP headers on Nvidia.

Doing so, the HIP tested was successful but the HIP-BLAS one showed two
issues:

* One seems to be related to include search paths as the HIP header uses
  #include "library_types.h" to include that CUDA header. Seemingly, it
  tried to included (again) the HIP header hip/library_types.h, not the
  CUDA one. I guess, some tweaking of -isystem vs. -I could have
  prevented this, but the simpler workaround was to just explicitly
  include the CUDA one before the HIP header files.

* Once done, everything compiled but linking failed as the association
  between three HIP-BLAS functions and their CUDA-BLAS ones did not
  work. Solution: Just add three #define for mapping them.

libgomp/ChangeLog:

* testsuite/lib/libgomp.exp
(check_effective_target_gomp_hip_header_nvidia): Compile with
"-Wno-deprecated-declarations".
* testsuite/libgomp.c/interop-hip-nvidia-full.c: Likewise.
* testsuite/libgomp.c/interop-hipblas-nvidia-full.c: Likewise.
* testsuite/libgomp.c/interop-hipblas.h: Add workarounds
when using the HIP headers with __HIP_PLATFORM_NVIDIA__.

(cherry picked from commit 8ef0518bce489c4c0c252a0e0c44193c5f7cf777)
libgomp/ChangeLog.omp
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp.c/interop-hip-nvidia-full.c
libgomp/testsuite/libgomp.c/interop-hipblas-nvidia-full.c
libgomp/testsuite/libgomp.c/interop-hipblas.h