]> 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:26:30 +0000 (18:26 +0200)
commit8ef0518bce489c4c0c252a0e0c44193c5f7cf777
tree76736eb1b015ba2724b1beff4665301f05e373e1
parent2fb6ddd45872f04306375572c281ec65ee59c761
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__.
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