]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp: Add openacc_{cuda,cublas,cudart} effective targets and use them in openacc...
authorJakub Jelinek <jakub@redhat.com>
Thu, 27 May 2021 20:44:36 +0000 (22:44 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 27 May 2021 20:44:36 +0000 (22:44 +0200)
commit79e3f7d54bc4e34b096082d3b90042d9f0fbaf1a
treea212cde21091bcda9eb38591ffbcc50d00d2b770
parenta617e5d516b508dfea411cf3e82e407f7beed170
libgomp: Add openacc_{cuda,cublas,cudart} effective targets and use them in openacc testsuite

When gcc is configured for nvptx offloading with --without-cuda-driver
and full CUDA isn't installed, many libgomp.oacc-*/* tests fail,
some of them because cuda.h header can't be found, others because
the tests can't be linked against -lcuda, -lcudart or -lcublas.
I usually only have akmod-nvidia and xorg-x11-drv-nvidia-cuda rpms
installed, so libcuda.so.1 can be dlopened and the offloading works,
but linking against those libraries isn't possible nor are the
headers around (for the plugin itself there is the fallback
libgomp/plugin/cuda/cuda.h).

The following patch adds 3 new effective targets and uses them in tests that
needs those.

2021-05-27  Jakub Jelinek  <jakub@redhat.com>

* testsuite/lib/libgomp.exp (check_effective_target_openacc_cuda,
check_effective_target_openacc_cublas,
check_effective_target_openacc_cudart): New.
* testsuite/libgomp.oacc-fortran/host_data-4.f90: Require effective
target openacc_cublas.
* testsuite/libgomp.oacc-fortran/host_data-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/host_data-3.f: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-91.c: Require effective
target openacc_cuda.
* testsuite/libgomp.oacc-c-c++-common/lib-70.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-90.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-75.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-69.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-74.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-81.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-72.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-85.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/pr87835.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-82.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-73.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-83.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-78.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-76.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-84.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/lib-79.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/host_data-1.c: Require effective
targets openacc_cublas and openacc_cudart.
* testsuite/libgomp.oacc-c-c++-common/context-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/context-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/context-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/context-4.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/acc_get_property-nvptx.c:
Require effective target openacc_cudart.
* testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c: Add -DUSE_CUDA_H
for effective target openacc_cuda and add && defined USE_CUDA_H to
preprocessor conditionals.  Guard -lcuda also on openacc_cuda
effective target.
28 files changed:
libgomp/testsuite/lib/libgomp.exp
libgomp/testsuite/libgomp.oacc-c-c++-common/acc_get_property-nvptx.c
libgomp/testsuite/libgomp.oacc-c-c++-common/asyncwait-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/context-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/context-2.c
libgomp/testsuite/libgomp.oacc-c-c++-common/context-3.c
libgomp/testsuite/libgomp.oacc-c-c++-common/context-4.c
libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-69.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-70.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-72.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-73.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-74.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-75.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-76.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-78.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-79.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-81.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-82.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-83.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-84.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-85.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-90.c
libgomp/testsuite/libgomp.oacc-c-c++-common/lib-91.c
libgomp/testsuite/libgomp.oacc-c-c++-common/pr87835.c
libgomp/testsuite/libgomp.oacc-fortran/host_data-2.f90
libgomp/testsuite/libgomp.oacc-fortran/host_data-3.f
libgomp/testsuite/libgomp.oacc-fortran/host_data-4.f90