From patchwork Fri Nov 15 21:44:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1195872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513696-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fFeFihD4"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47FBkB138Jz9sPV for ; Sat, 16 Nov 2019 08:46:09 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; q=dns; s= default; b=UMJvU8CB3mf2lhcDgDRVpKPg6F2EZpFiDmn0fpOkS2cnH3W7LPsKg dP24UdKekf5UmK2JIeofWifxxISI4cChclExRcdK0qCsQyB79TNXdKW2vlrsMi5p n+NcAYN5FmqlXPcCZfBgSR+Mk11gSRNYgfLcDHh7Cv+xYJK6VYNF0U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=default; bh=IC579xJvi3GFZpF18r+JhKpVwO8=; b=fFeFihD4+OqZqpQmiOlWp0MqT515 l1OSAoE2dpSVnduFOg92RdSgE1eMy7DQNaE4gQLF5vVLP3vNCiEvUuV4CqwGp0hK pKW6G1wJefvFGx08eFFp0yPJqE8Xq+0pU6SZnWTzc04cD2kKj2dNXDdbo1LGRMRV hRU4ZW8u4Nr3FN0= Received: (qmail 61043 invoked by alias); 15 Nov 2019 21:46:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 61002 invoked by uid 89); 15 Nov 2019 21:46:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=Workers, single-worker, singleworker, Until 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; Fri, 15 Nov 2019 21:46:00 +0000 IronPort-SDR: Hwo0A9TC6j6osaYuDh7ijB892vF6YH6kZt8JphjZyqCQFBB9Gta29nJLng1Zn73sGgUXxCkut9 diUV0TjpDZA9V6n2k+hHbamz8yfkwm2QeqnYHb57gc3ZrzPp5/qWejeQ5jBw1hJrySMWNcKL7K H4MuIg0kjzCFBFnwFrDiszoMcBle/NSqaPgbZjKhqPMs+xdYlMqJZAstK9NxeYJMmdwldAPo8x FTvbQs2nRzF1BO8bMDejWKDGITNAVz8mUQly6G1nunyyUOe2p+XL9jts/qo+G94aS+OUwdM2WS RMo= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 15 Nov 2019 13:45:59 -0800 IronPort-SDR: n8SwvqE2tfXuNjzjbjzAQ1iPXOd/oqmQdzYPjUqSPhcfYdZyayfFBQK76C5zdnbw8p35hAqkfm fDc7dWAJncVUusUnor+ZkT/8L6dCuzwSSYibyDmtSpW56Lrx/HCq7Lr8pbFR3C9BiUao61JwrV Yig+iArGZcjHn+dnk9QwhQRfrR5oLN0MQkmyIcSPl4l87fCQ7kETg1vFvnI2qii12L9TwMII6n E2bjIpglrgZqZ8/4v02wTrJCoQWw0na74BvJO9MrthZsD2iZ8ocJH9Hp3ZkgIcBTzKgzpqEF+z DCY= From: Julian Brown To: CC: , , , Andrew Stubbs Subject: [PATCH 13/13] Enable worker partitioning for AMD GCN Date: Fri, 15 Nov 2019 13:44:06 -0800 Message-ID: <4d2adc5e64b42f4834ce56477f382c3d2bd81542.1573849744.git.julian@codesourcery.com> In-Reply-To: References: MIME-Version: 1.0 X-IsSubscribed: yes This patch flips the switch to enable worker partitioning on AMD GCN. OK? Thanks, 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/config/gcn/gcn.c | 4 ++-- gcc/config/gcn/gcn.opt | 2 +- libgomp/plugin/plugin-gcn.c | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 3584ac85021..6e45032ea3a 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -4692,8 +4692,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. */ @@ -6072,6 +6070,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 402deb625bd..bdc878f35ad 100644 --- a/gcc/config/gcn/gcn.opt +++ b/gcc/config/gcn/gcn.opt @@ -65,7 +65,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/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index c4347dfa45d..3368d7e261a 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -3097,10 +3097,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",