diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2023-05-04 09:07:35 +0200 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2023-05-08 16:00:00 +0200 |
commit | 1b93b9191d073bf9e867ab8bfc8e4b59ba5af1f3 (patch) | |
tree | 19bab903134aad6af37452c997fff47991dbc1c8 /libgomp | |
parent | d6654a4be3ba44c0d57be7c8a51d76d9721345e1 (diff) | |
download | gcc-1b93b9191d073bf9e867ab8bfc8e4b59ba5af1f3.zip gcc-1b93b9191d073bf9e867ab8bfc8e4b59ba5af1f3.tar.gz gcc-1b93b9191d073bf9e867ab8bfc8e4b59ba5af1f3.tar.bz2 |
libgomp C++ testsuite: Use 'lang_include_flags' instead of 'libstdcxx_includes'
With nvptx offloading configured, and supported, and CUDA available:
$ make check-target-libgomp RUNTESTFLAGS="--all c.exp=context-1.c c++.exp=context-1.c"
[...]
Running [...]/libgomp.oacc-c/c.exp ...
PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 (test for excess errors)
PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 execution test
PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2 (test for excess errors)
PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2 execution test
UNSUPPORTED: libgomp.oacc-c/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O2
Running [...]/libgomp.oacc-c++/c++.exp ...
PASS: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 (test for excess errors)
PASS: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0 execution test
PASS: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2 (test for excess errors)
PASS: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2 execution test
UNSUPPORTED: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O2
[...]
..., but for 'c++.exp=context-1.c' alone, we currently get all-UNSUPPORTED:
$ make check-target-libgomp RUNTESTFLAGS_="--all c++.exp=context-1.c"
[...]
Running [...]/libgomp.oacc-c++/c++.exp ...
UNSUPPORTED: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O0
UNSUPPORTED: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2
UNSUPPORTED: libgomp.oacc-c++/../libgomp.oacc-c-c++-common/context-1.c -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1 -foffload=disable -O2
[...]
That is, if 'c.exp' executes first, it does successfully evaluate
'dg-require-effective-target openacc_cublas' -- and does cache this result (so
it isn't reevaluated for 'c++.exp'). However, for 'c++.exp' alone (that is,
without the 'c.exp' result cached), we run into:
spawn -ignore SIGHUP [xgcc] [...] -x c++ openacc_cublas2311907.c [...]
In file included from /usr/include/cuda_fp16.h:3673,
from /usr/include/cublas_api.h:75,
from /usr/include/cublas_v2.h:65,
from openacc_cublas2311907.c:3:
/usr/include/cuda_fp16.hpp:67:10: fatal error: utility: No such file or directory
We're missing include paths to C++/libstdc++ build-tree headers.
Fix this by using the mechanism introduced for Fortran in
r212268 (commit f707da16f714f7fe5a42391748212c84dfec639b) re
"libgomp.fortran/fortran.exp - add -fintrinsic-modules-path ${blddir}".
libgomp/
* testsuite/libgomp.c++/c++.exp: Use 'lang_include_flags' instead
of 'libstdcxx_includes'.
* testsuite/libgomp.oacc-c++/c++.exp: Likewise.
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/testsuite/libgomp.c++/c++.exp | 7 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c++/c++.exp | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/libgomp/testsuite/libgomp.c++/c++.exp b/libgomp/testsuite/libgomp.c++/c++.exp index f4884e2..5b9a592 100644 --- a/libgomp/testsuite/libgomp.c++/c++.exp +++ b/libgomp/testsuite/libgomp.c++/c++.exp @@ -66,13 +66,12 @@ if { $lang_test_file_found } { set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags" if { [file exists $flags_file] } { - set libstdcxx_includes [exec sh $flags_file --build-includes] - } else { - set libstdcxx_includes "" + set lang_source_re {^.*\.[cC]$} + set lang_include_flags [exec sh $flags_file --build-includes] } # Main loop. - dg-runtest $tests "" "$libstdcxx_includes $DEFAULT_CFLAGS" + dg-runtest $tests "" $DEFAULT_CFLAGS } # See above. diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index 42e0395..0b235ba 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -72,9 +72,8 @@ if { $lang_test_file_found } { set flags_file "${blddir}/../libstdc++-v3/scripts/testsuite_flags" if { [file exists $flags_file] } { - set libstdcxx_includes [exec sh $flags_file --build-includes] - } else { - set libstdcxx_includes "" + set lang_source_re {^.*\.[cC]$} + set lang_include_flags [exec sh $flags_file --build-includes] } # Test with all available offload targets, and with offloading disabled. @@ -147,7 +146,7 @@ if { $lang_test_file_found } { } } - gcc-dg-runtest $tests "$tagopt" "$libstdcxx_includes" + gcc-dg-runtest $tests "$tagopt" "" } unset offload_target } else { |