[2/3,og9] Fix configury for AMD GCN testing
diff mbox series

Message ID 20190808165307.56375-3-julian@codesourcery.com
State New
Headers show
Series
  • Initial OpenACC fixes for AMD GCN
Related show

Commit Message

Julian Brown Aug. 8, 2019, 4:53 p.m. UTC
This patch updates the configury for AMD GCN for version
of the patch "Forward -foffload=[...] from the driver (compile-time)
to libgomp (run-time)" currently applied to the og9 branch. This is
necessary for OpenACC testing on AMD GCN to work properly, at least in
our test environment.

Julian

ChangeLog

	libgomp/
	* plugin/configfrag.ac (amdgcn): Set tgt_plugin.
	* testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type):
	Add AMD GCN support.
	(check_effective_target_openacc_amdgcn_accel_selected): Test
	offload_target instead of offload_target_openacc.
	* testsuite/libgomp.oacc-c++/c++.exp (amdgcn*): Rename stanza to...
	(gcn): ...this. Don't set tagopt redundantly here.
	* testsuite/libgomp.oacc-c/c.exp (amdgcn*, gcn): Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp (amdgcn*, gcn): Likewise.
	* configure: Regenerated.
---
 libgomp/ChangeLog.openacc                          | 13 +++++++++++++
 libgomp/configure                                  |  1 +
 libgomp/plugin/configfrag.ac                       |  1 +
 libgomp/testsuite/lib/libgomp.exp                  |  7 +++++--
 libgomp/testsuite/libgomp.oacc-c++/c++.exp         |  3 +--
 libgomp/testsuite/libgomp.oacc-c/c.exp             |  3 +--
 libgomp/testsuite/libgomp.oacc-fortran/fortran.exp |  3 +--
 7 files changed, 23 insertions(+), 8 deletions(-)

Patch
diff mbox series

diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc
index 80d089f49e2..62c56e3bf92 100644
--- a/libgomp/ChangeLog.openacc
+++ b/libgomp/ChangeLog.openacc
@@ -1,3 +1,16 @@ 
+2019-08-08  Julian Brown  <julian@codesourcery.com>
+
+	* plugin/configfrag.ac (amdgcn): Set tgt_plugin.
+	* testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type):
+	Add AMD GCN support.
+	(check_effective_target_openacc_amdgcn_accel_selected): Test
+	offload_target instead of offload_target_openacc.
+	* testsuite/libgomp.oacc-c++/c++.exp (amdgcn*): Rename stanza to...
+	(gcn): ...this. Don't set tagopt redundantly here.
+	* testsuite/libgomp.oacc-c/c.exp (amdgcn*, gcn): Likewise.
+	* testsuite/libgomp.oacc-fortran/fortran.exp (amdgcn*, gcn): Likewise.
+	* configure: Regenerated.
+
 2019-08-08  Julian Brown  <julian@codesourcery.com>
 
 	* plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_exec_params,
diff --git a/libgomp/configure b/libgomp/configure
index 39da8af4546..85a29c5b5e1 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -15781,6 +15781,7 @@  rm -f core conftest.err conftest.$ac_objext \
 		;;
 	      *)
 		tgt_name=gcn
+		tgt_plugin=gcn
 		PLUGIN_GCN=$tgt
 		PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
 		PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac
index 6fedd28eccc..1ea67c913ba 100644
--- a/libgomp/plugin/configfrag.ac
+++ b/libgomp/plugin/configfrag.ac
@@ -256,6 +256,7 @@  if test x"$enable_offload_targets" != x; then
 		;;
 	      *)
 		tgt_name=gcn
+		tgt_plugin=gcn
 		PLUGIN_GCN=$tgt
 		PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS
 		PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS"
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index 19bee806fb0..9644176da2a 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -316,6 +316,9 @@  proc offload_target_to_openacc_device_type { offload_target } {
 	nvptx* {
 	    return "nvidia"
 	}
+	amdgcn* {
+	    return "gcn"
+	}
 	default {
 	    error "Unknown offload target: $offload_target"
 	}
@@ -463,8 +466,8 @@  proc check_effective_target_openacc_amdgcn_accel_selected { } {
     if { ![check_effective_target_openacc_amdgcn_accel_present] } {
 	return 0;
     }
-    global offload_target_openacc
-    if { [string match "amdgcn*" $offload_target_openacc] } {
+    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 1285a6a1c6d..86aacff0c37 100644
--- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp
+++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp
@@ -111,9 +111,8 @@  if { $lang_test_file_found } {
 
 		set acc_mem_shared 0
 	    }
-	    amdgcn* {
+	    gcn {
 		set acc_mem_shared 0
-		set tagopt "-DACC_DEVICE_TYPE_gcn=\"$offload_target_openacc\""
 	    }
 	    default {
 		error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp
index f7005ebba48..9ab68bbef14 100644
--- a/libgomp/testsuite/libgomp.oacc-c/c.exp
+++ b/libgomp/testsuite/libgomp.oacc-c/c.exp
@@ -72,9 +72,8 @@  foreach offload_target [concat [split $offload_targets ":"] "disable"] {
 
 	    set acc_mem_shared 0
 	}
-	amdgcn* {
+	gcn {
 	    set acc_mem_shared 0
-	    set tagopt "-DACC_DEVICE_TYPE_gcn=\"$offload_target_openacc\""
 	}
 	default {
 	    error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
index 0f8d1db4895..e36fb15c1ca 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp
@@ -90,9 +90,8 @@  if { $lang_test_file_found } {
 
 		set acc_mem_shared 0
 	    }
-	    amdgcn* {
+	    gcn {
 		set acc_mem_shared 0
-		set tagopt "-DACC_DEVICE_TYPE_gcn=\"$offload_target_openacc\""
 	    }
 	    default {
 		error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)"