diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2019-12-03 12:53:53 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2019-12-03 12:53:53 +0000 |
commit | 83caa34e2a618842e05f59cbb3e2dda93dc23270 (patch) | |
tree | d2e2e9f715d2b9eb06ba548d68729e7883757533 /libgomp | |
parent | 5105b576dfdcae0c6cc30a89a68b4ef3cbf56a1c (diff) | |
download | gcc-83caa34e2a618842e05f59cbb3e2dda93dc23270.zip gcc-83caa34e2a618842e05f59cbb3e2dda93dc23270.tar.gz gcc-83caa34e2a618842e05f59cbb3e2dda93dc23270.tar.bz2 |
Enable OpenACC GCN testing.
2019-12-03 Andrew Stubbs <ams@codesourcery.com>
libgomp/
* testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type):
Recognize amdgcn.
(check_effective_target_openacc_amdgcn_accel_present): New proc.
(check_effective_target_openacc_amdgcn_accel_selected): New proc.
* testsuite/libgomp.oacc-c++/c++.exp: Add support for amdgcn.
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
From-SVN: r278935
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 10 | ||||
-rw-r--r-- | libgomp/testsuite/lib/libgomp.exp | 29 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c++/c++.exp | 9 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c/c.exp | 9 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-fortran/fortran.exp | 9 |
5 files changed, 66 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 86761d3..af5add8 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2019-12-03 Andrew Stubbs <ams@codesourcery.com> + + * testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type): + Recognize amdgcn. + (check_effective_target_openacc_amdgcn_accel_present): New proc. + (check_effective_target_openacc_amdgcn_accel_selected): New proc. + * testsuite/libgomp.oacc-c++/c++.exp: Add support for amdgcn. + * testsuite/libgomp.oacc-c/c.exp: Likewise. + * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. + 2019-12-03 Szabolcs Nagy <szabolcs.nagy@arm.com> PR libgomp/91938 diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 06e3186..f52ed71 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -318,6 +318,9 @@ proc libgomp_option_proc { option } { # not supported, and 'host' for offload target 'disable'. proc offload_target_to_openacc_device_type { offload_target } { switch -glob $offload_target { + amdgcn* { + return "gcn" + } disable { return "host" } @@ -479,3 +482,29 @@ proc check_effective_target_hsa_offloading_selected {} { check_effective_target_hsa_offloading_selected_nocache }] } + +# Return 1 if at least one AMD GCN board is present. + +proc check_effective_target_openacc_amdgcn_accel_present { } { + return [check_runtime openacc_amdgcn_accel_present { + #include <openacc.h> + int main () { + return !(acc_get_num_devices (acc_device_gcn) > 0); + } + } "" ] +} + +# Return 1 if at least one AMD GCN board is present, and the AMD GCN device +# type is selected by default. + +proc check_effective_target_openacc_amdgcn_accel_selected { } { + if { ![check_effective_target_openacc_amdgcn_accel_present] } { + return 0; + } + global offload_target + if { [string match "amdgcn*" $offload_target] } { + return 1; + } + return 0; +} + diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index dcefa79..c06c2a0 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -88,6 +88,15 @@ if { $lang_test_file_found } { unsupported "$subdir $offload_target offloading" continue } + gcn { + if { ![check_effective_target_openacc_amdgcn_accel_present] } { + # Don't bother; execution testing is going to FAIL. + untested "$subdir $offload_target offloading: supported, but hardware not accessible" + continue + } + + set acc_mem_shared 0 + } host { set acc_mem_shared 1 } diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp index 55cd40f..7f13242 100644 --- a/libgomp/testsuite/libgomp.oacc-c/c.exp +++ b/libgomp/testsuite/libgomp.oacc-c/c.exp @@ -51,6 +51,15 @@ foreach offload_target [concat [split $offload_targets ","] "disable"] { unsupported "$subdir $offload_target offloading" continue } + gcn { + if { ![check_effective_target_openacc_amdgcn_accel_present] } { + # Don't bother; execution testing is going to FAIL. + untested "$subdir $offload_target offloading: supported, but hardware not accessible" + continue + } + + set acc_mem_shared 0 + } host { set acc_mem_shared 1 } diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp index 852f372..60f0889 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -82,6 +82,15 @@ if { $lang_test_file_found } { unsupported "$subdir $offload_target offloading" continue } + gcn { + if { ![check_effective_target_openacc_amdgcn_accel_present] } { + # Don't bother; execution testing is going to FAIL. + untested "$subdir $offload_target offloading: supported, but hardware not accessible" + continue + } + + set acc_mem_shared 0 + } host { set acc_mem_shared 1 } |