public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-11] Enable worker partitioning for AMD GCN
@ 2021-05-13 16:12 Kwok Yeung
  0 siblings, 0 replies; only message in thread
From: Kwok Yeung @ 2021-05-13 16:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2ec47f0ddcc6bc3414ac067e5833b2d8f5b09345

commit 2ec47f0ddcc6bc3414ac067e5833b2d8f5b09345
Author: Julian Brown <julian@codesourcery.com>
Date:   Tue Sep 3 08:57:39 2019 -0700

    Enable worker partitioning for AMD GCN
    
            gcc/
            * config/gcn/gcn.c (gcn_goacc_validate_dims): Remove
            no-flag_worker-partitioning assertion.
            (TARGET_GOACC_WORKER_PARTITIONING): Define target hook to true.
            * config/gcn/gcn.opt (flag_worker_partitioning): Change default to 1.
    
            libgomp/
            * plugin/plugin-gcn.c (gcn_exec): Change default number of workers to
            16.

Diff:
---
 gcc/ChangeLog.omp           | 7 +++++++
 gcc/config/gcn/gcn.c        | 4 ++--
 gcc/config/gcn/gcn.opt      | 2 +-
 libgomp/ChangeLog.omp       | 5 +++++
 libgomp/plugin/plugin-gcn.c | 4 +---
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp
index e64dd070eaa..228dbd54b58 100644
--- a/gcc/ChangeLog.omp
+++ b/gcc/ChangeLog.omp
@@ -1,3 +1,10 @@
+2019-09-05  Julian Brown  <julian@codesourcery.com>
+
+	* config/gcn/gcn.c (gcn_goacc_validate_dims): Remove
+	no-flag_worker-partitioning assertion.
+	(TARGET_GOACC_WORKER_PARTITIONING): Define target hook to true.
+	* config/gcn/gcn.opt (flag_worker_partitioning): Change default to 1.
+
 2019-09-05  Cesar Philippidis  <cesar@codesourcery.com>
 	    Julian Brown  <julian@codesourcery.com>
 
diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index e6800c21b20..286018b936b 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -4869,8 +4869,6 @@ 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.  */
@@ -6323,6 +6321,8 @@ gcn_dwarf_register_span (rtx rtl)
 #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 767d45826c2..f23d5984a82 100644
--- a/gcc/config/gcn/gcn.opt
+++ b/gcc/config/gcn/gcn.opt
@@ -65,7 +65,7 @@ Target RejectNegative Var(flag_bypass_init_error)
 bool flag_worker_partitioning = false
 
 macc-experimental-workers
-Target Var(flag_worker_partitioning) Init(0)
+Target Var(flag_worker_partitioning) Init(1)
 
 int stack_size_opt = -1
 
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index f026be5ad58..b67584271e4 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2019-09-05  Julian Brown  <julian@codesourcery.com>
+
+	* plugin/plugin-gcn.c (gcn_exec): Change default number of workers to
+	16.
+
 2019-09-05  Julian Brown  <julian@codesourcery.com>
 
 	* testsuite/libgomp.oacc-fortran/lib-13.f90: End data region after
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index 5818c0fff00..86263a67d32 100644
--- a/libgomp/plugin/plugin-gcn.c
+++ b/libgomp/plugin/plugin-gcn.c
@@ -3041,10 +3041,8 @@ 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] = get_cu_count (kernel->agent); /* Gangs.  */
-  if (dims[1] == 0) dims[1] = 1;  /* Workers.  */
+  if (dims[1] == 0) dims[1] = 16; /* Workers.  */
 
   /* The incoming dimensions are expressed in terms of gangs, workers, and
      vectors.  The HSA dimensions are expressed in terms of "work-items",


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-13 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 16:12 [gcc/devel/omp/gcc-11] Enable worker partitioning for AMD GCN Kwok Yeung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).