From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8709 invoked by alias); 5 Sep 2019 01:47:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 8578 invoked by uid 89); 5 Sep 2019 01:47:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Languages-Length:3929 X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Sep 2019 01:47:14 +0000 IronPort-SDR: a2RzYOPN5zlReVubOPA0o7wLid7P0bGtxmn3eK2p+E9AOf38C/yggb5cZ9NDR38K9OlhCOOclq r3KpGky8Xgduj59mGvAMnIVgZlGeTpR5uyFe+f1C1Ba4Z6VjfDu2JP8A+RKqCBH1gD/kX/L5lx QCq43xU9knWFgeLDqgF5fA/B62/cPn+AXGrMRn7BdAIAXJPdOjlg3BtSoDmBQ4PvQD1ttmwLys Lw4Yu/FW4wGWhu8IPnPWl4NfJpOY2h1l1RI9TLCxwR60S1cDyjRDSR5QGtUxxkEQ5lyDU7/hPV JMA= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 04 Sep 2019 17:47:12 -0800 IronPort-SDR: euVMwlWzYps8W3l1JIFf5r4r+3DZxJ/a/S7wVWv0+6T4u7Upxo4Vsdp/EauNZr3wT1uxpjdkof XST1ctdQb1ABTdddTh8JNw0PBAkL6km4vScGWtf7e/XfeBtjrmE/VNXC8xz8ikXrGU+AD9IF5M 3tYJFuEfEoXTaxUtfgTyDhelfZtRaEOB1S4mPgmE9YZW0s/XaDIE3KaM39yQuRmImjhgRYHXn1 J/vbO5KXxuc4naCFWGf89qBxy97wgnAu5/6McXDl2Qm7RU6s3QcmrQM7Wz5ErtXLa1L41WSF7f SZ4= From: Julian Brown To: CC: Andrew Stubbs Subject: [PATCH 6/6] [og9] Enable worker partitioning for AMD GCN Date: Thu, 05 Sep 2019 01:47:00 -0000 Message-ID: <79e7692178509467f622ecc649cda6aa8717406a.1567644180.git.julian@codesourcery.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Return-Path: julian@codesourcery.com X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00233.txt.bz2 This patch enables middle-end worker partitioning and multiple workers on AMD GCN. Julian ChangeLog 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.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, 16 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog.openacc b/gcc/ChangeLog.openacc index 2b7f616810d..dde474d144d 100644 --- a/gcc/ChangeLog.openacc +++ b/gcc/ChangeLog.openacc @@ -1,3 +1,10 @@ +2019-09-05 Julian Brown + + * 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 Julian Brown diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index ca9321b5f25..b7cf6f093fa 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -4659,8 +4659,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. */ @@ -6035,6 +6033,8 @@ 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 90d35f42e57..2fd3996edba 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(0) +Target Report Var(flag_worker_partitioning) Init(1) int stack_size_opt = -1 diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index c7ef40e922c..438bd59b47b 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-09-05 Julian Brown + + * plugin/plugin-gcn.c (gcn_exec): Change default number of workers to + 16. + 2019-09-05 Julian Brown * 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 099f70b647c..f0b22ebc3d7 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -3244,10 +3244,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] = 64; /* 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", -- 2.22.0