Commit 83caa34e by Andrew Stubbs Committed by Andrew Stubbs

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
parent 5105b576
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> 2019-12-03 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR libgomp/91938 PR libgomp/91938
......
...@@ -318,6 +318,9 @@ proc libgomp_option_proc { option } { ...@@ -318,6 +318,9 @@ proc libgomp_option_proc { option } {
# not supported, and 'host' for offload target 'disable'. # not supported, and 'host' for offload target 'disable'.
proc offload_target_to_openacc_device_type { offload_target } { proc offload_target_to_openacc_device_type { offload_target } {
switch -glob $offload_target { switch -glob $offload_target {
amdgcn* {
return "gcn"
}
disable { disable {
return "host" return "host"
} }
...@@ -479,3 +482,29 @@ proc check_effective_target_hsa_offloading_selected {} { ...@@ -479,3 +482,29 @@ proc check_effective_target_hsa_offloading_selected {} {
check_effective_target_hsa_offloading_selected_nocache 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;
}
...@@ -88,6 +88,15 @@ if { $lang_test_file_found } { ...@@ -88,6 +88,15 @@ if { $lang_test_file_found } {
unsupported "$subdir $offload_target offloading" unsupported "$subdir $offload_target offloading"
continue 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 { host {
set acc_mem_shared 1 set acc_mem_shared 1
} }
......
...@@ -51,6 +51,15 @@ foreach offload_target [concat [split $offload_targets ","] "disable"] { ...@@ -51,6 +51,15 @@ foreach offload_target [concat [split $offload_targets ","] "disable"] {
unsupported "$subdir $offload_target offloading" unsupported "$subdir $offload_target offloading"
continue 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 { host {
set acc_mem_shared 1 set acc_mem_shared 1
} }
......
...@@ -82,6 +82,15 @@ if { $lang_test_file_found } { ...@@ -82,6 +82,15 @@ if { $lang_test_file_found } {
unsupported "$subdir $offload_target offloading" unsupported "$subdir $offload_target offloading"
continue 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 { host {
set acc_mem_shared 1 set acc_mem_shared 1
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment