This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/3] [og9] Use a single worker for OpenACC on AMD GCN
- From: Julian Brown <julian at codesourcery dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: Andrew Stubbs <andrew_stubbs at mentor dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 8 Aug 2019 09:53:07 -0700
- Subject: [PATCH 3/3] [og9] Use a single worker for OpenACC on AMD GCN
- Ironport-sdr: OshzVc9pWeDTCN7h8h7tCFSkpbdnzaRs5NefmpwmogsUaOw3gRfeRPl1MJcSXWLMbTd+GIvvzc JjXQaFl8oeeiCx1DKFDwlRZUpIBbXiXoMt1ZDdwEkZb6YYkuPjebFCEjQ7S+J/LjgoKDTSYtu7 L4ck2WpOIgA1ib6LUZGJtSj9inuiLQbYOrpAzKPUJj8gIwaVJu1BPF04sp1aNl6NfTcTLOE8wj rMSSgqPw4ag4FgoQb01RigJozYjENtlMVgwBAbChKfJGOqrODsovQSsT11/4bbXaWA747Zao2j gJ4=
- Ironport-sdr: 9wa+PADmcRu+JXzFA6FkMgpp7ZiH0rRT0u31tVSCj/EKdmGZs6vRKrpESpj8rqnztsMSEAUYt/ EI2igzyXKxEDIAh+gtYI3NOKCkCh/S5ZLRGKsHEUk2bjJEKZHW0vbaWgFg6aG2QOKqyqtxlEEk BZN3m0/qKEV16OVU4dKUXK2VYyQ0h6RcGpvWQYVdDcSPZBEEA32b7cOEApgBtXwQPGLONkXWAs NddVAL0Gtvo7in97TEdPYKwt4xlPxUCRN9QQuFzRjxD+w7frieQ5yvsVgIHSoKF0fJneUHSpfB G70=
- References: <20190808165307.56375-1-julian@codesourcery.com>
This patch sets the number of workers (per-gang) to 1 for AMD GCN,
as a stop-gap measure until the middle-end transformations to enable
multiple workers have been applied.
Julian
ChangeLog
gcc/
* config/gcn/gcn.c (gcn_goacc_validate_dims): Ensure
flag_worker_partitioning is not set.
(TARGET_GOACC_WORKER_PARTITIONING): Remove target hook definition.
* config/gcn/gcn.opt (macc-experimental-workers): Default to off.
libgomp/
* plugin/plugin-gcn.c (gcn_exec): Use 1 for the default number of
workers.
---
gcc/ChangeLog.openacc | 7 +++++++
gcc/config/gcn/gcn.c | 4 ++--
gcc/config/gcn/gcn.opt | 2 +-
libgomp/ChangeLog.openacc | 5 +++++
libgomp/plugin/plugin-gcn.c | 4 +++-
5 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/gcc/ChangeLog.openacc b/gcc/ChangeLog.openacc
index 0caa1cd1401..84d80511603 100644
--- a/gcc/ChangeLog.openacc
+++ b/gcc/ChangeLog.openacc
@@ -1,3 +1,10 @@
+2019-08-08 Julian Brown <julian@codesourcery.com>
+
+ * config/gcn/gcn.c (gcn_goacc_validate_dims): Ensure
+ flag_worker_partitioning is not set.
+ (TARGET_GOACC_WORKER_PARTITIONING): Remove target hook definition.
+ * config/gcn/gcn.opt (macc-experimental-workers): Default to off.
+
2019-07-31 Julian Brown <julian@codesourcery.com>
* builtin-types.def (BT_FN_VOID_INT_INT_OMPFN_SIZE_PTR_PTR_PTR_VAR):
diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index 9f73fc8161a..f3f112d95a9 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -4662,6 +4662,8 @@ gcn_goacc_validate_dims (tree decl, int dims[], int fn_level,
/* FIXME: remove -facc-experimental-workers when they're ready. */
int max_workers = flag_worker_partitioning ? 16 : 1;
+ gcc_assert (!flag_worker_partitioning);
+
/* The vector size must appear to be 64, to the user, unless this is a
SEQ routine. The real, internal value is always 1, which means use
autovectorization, but the user should not see that. */
@@ -6038,8 +6040,6 @@ print_operand (FILE *file, rtx x, int code)
#define TARGET_GOACC_REDUCTION gcn_goacc_reduction
#undef TARGET_GOACC_VALIDATE_DIMS
#define TARGET_GOACC_VALIDATE_DIMS gcn_goacc_validate_dims
-#undef TARGET_GOACC_WORKER_PARTITIONING
-#define TARGET_GOACC_WORKER_PARTITIONING true
#undef TARGET_HARD_REGNO_MODE_OK
#define TARGET_HARD_REGNO_MODE_OK gcn_hard_regno_mode_ok
#undef TARGET_HARD_REGNO_NREGS
diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt
index 2fd3996edba..90d35f42e57 100644
--- a/gcc/config/gcn/gcn.opt
+++ b/gcc/config/gcn/gcn.opt
@@ -62,7 +62,7 @@ Target Report RejectNegative Var(flag_bypass_init_error)
bool flag_worker_partitioning = false
macc-experimental-workers
-Target Report Var(flag_worker_partitioning) Init(1)
+Target Report Var(flag_worker_partitioning) Init(0)
int stack_size_opt = -1
diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc
index 62c56e3bf92..2279545f361 100644
--- a/libgomp/ChangeLog.openacc
+++ b/libgomp/ChangeLog.openacc
@@ -1,3 +1,8 @@
+2019-08-08 Julian Brown <julian@codesourcery.com>
+
+ * plugin/plugin-gcn.c (gcn_exec): Use 1 for the default number of
+ workers.
+
2019-08-08 Julian Brown <julian@codesourcery.com>
* plugin/configfrag.ac (amdgcn): Set tgt_plugin.
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index 6eaae66c1a9..a41568b3306 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -3233,8 +3233,10 @@ gcn_exec (struct kernel_info *kernel, size_t mapnum, void **hostaddrs,
problem size, so let's do a reasonable number of single-worker gangs.
64 gangs matches a typical Fiji device. */
+ /* NOTE: Until support for middle-end worker partitioning is merged, use 1
+ for the default number of workers. */
if (dims[0] == 0) dims[0] = 64; /* Gangs. */
- if (dims[1] == 0) dims[1] = 16; /* Workers. */
+ if (dims[1] == 0) dims[1] = 1; /* Workers. */
/* The incoming dimensions are expressed in terms of gangs, workers, and
vectors. The HSA dimensions are expressed in terms of "work-items",