]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Enable worker partitioning for AMD GCN
authorJulian Brown <julian@codesourcery.com>
Tue, 3 Sep 2019 15:57:39 +0000 (08:57 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Wed, 21 Apr 2021 16:33:52 +0000 (09:33 -0700)
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.

gcc/ChangeLog.omp
gcc/config/gcn/gcn.c
gcc/config/gcn/gcn.opt
libgomp/ChangeLog.omp
libgomp/plugin/plugin-gcn.c

index e64dd070eaaa03862aa811788a68befad3f5eef6..228dbd54b584df20742a62baa45539033a4abb1e 100644 (file)
@@ -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>
 
index e6800c21b20b203a3a7442ec0b9ec20552efc948..286018b936b6ec5eb46e64aee4965383765f375d 100644 (file)
@@ -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
index 767d45826c2f8436a15e4dd4e605125d06d80c2a..f23d5984a82b651970d385cbf1925923a2ada72a 100644 (file)
@@ -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
 
index f026be5ad582fca8a5e214cda3d45f083adb627d..b67584271e4a4a2a752cf5934e6de59898e0f96d 100644 (file)
@@ -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
index 5818c0fff00ecb18a714808429454bc31ac85eb1..86263a67d32569322338f03818881240e44ee37e 100644 (file)
@@ -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",