From patchwork Thu Aug 8 16:53:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1144120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-506529-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="PP6T+pWx"; 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 464Dwr64whz9sBF for ; Fri, 9 Aug 2019 02:54:04 +1000 (AEST) 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-type:content-transfer-encoding; q=dns; s= default; b=wMDdzzfEMlD6HjhiJ06R2QP4T1aU7iOREdQAwv1pHZGgrnsHA7h2f 1lnyXYOkkvd+bsGToOAsUowint9RTh5eZuJUtcyR1oT2ewoTVbZfHSoVR1PiKIaT Vie0yMZS4fW5Dh6JGcQY7HT2NfpbFcIj8+sQL/20FyOWa/8jiG+TxM= 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-type:content-transfer-encoding; s=default; bh=UNoxo2/ToQLZ/MSAdHx8HCnljxg=; b=PP6T+pWx2MnOMB1SSPAZ6vqkPaGs VpSq9HaGBY5tQNSuclGCi9aNuNbhCyY4JOgF2X0258v/wg/uRiAfT55YVLnEVSRk 9npGlGDYIznfmFCqjOXf92zH34ptImNFz5/5Tss/J6EGBi9PtpxWRXFBMXaSL4Lm Aih1tpdR0+rDiB4= Received: (qmail 71532 invoked by alias); 8 Aug 2019 16:53:46 -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 71476 invoked by uid 89); 8 Aug 2019 16:53:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.2 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=20190731, *aq, device, HContent-Transfer-Encoding:8bit X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Aug 2019 16:53:44 +0000 IronPort-SDR: 7ON8+hK6U/hXJdUmDSJTPqjFb7P2vSIeMvOC9q8aiMublaXrcTpD0XS8LxcEM61kAXjrqkDG8r 3y7CxsrpBbH3dzj7qBHWaUSUU5JOAw9jXXX6dqSE3w2WLxVZ2I3o5Z/NiZxfIwXA8A6jwVxsQJ 9VmfQWXcxzzGCMNnOp9rCoibSmresady02X4MzpDIpN6KluMxnz+rkyF1WM0eoxq4hsMKe5suV XRUY9S31qnaFtpJTQXksYWs7vZ9s6IWF7fx4NwJ2qcDUdHFClByqEPoRLXZ6iHAoQ/JOsH289q eX8= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 08 Aug 2019 08:53:24 -0800 IronPort-SDR: +MUWyNy3mxS8XUp4PxpgvLTLRa1RPWYUOrd+eG201va11AJLngTtmihG9xNOVX2LWRxUZV5mDl AVndbP2vPzO93GzlfbQcCO92Psrk01dnKOFvVexl/i/Uw/VNYhFVi1veQRqmITljkUbokbilIq KRYH2v/WQaKthBrVu58bqXwUF+qD2qF9GN5SpEoSzieyUz8eVRWKVHUlLJBvuup+LusgrRstpm aizL9EHROBLm4h+eFGsmAOVgZMWLirKEl/PRefjRgUgLRbLqI+dKqviMltwncvW9efdoHsWnHF j5A= From: Julian Brown To: CC: Andrew Stubbs , Jakub Jelinek Subject: [PATCH 1/3] [og9] Add missing exec_params libgomp plugin entry points Date: Thu, 8 Aug 2019 09:53:05 -0700 Message-ID: <20190808165307.56375-2-julian@codesourcery.com> In-Reply-To: <20190808165307.56375-1-julian@codesourcery.com> References: <20190808165307.56375-1-julian@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch adds two missing (dummy) entry points to the GCN libgomp plugin. These are not used at present, because we have not enabled the function parameter flattening transformation that uses these entry points on GCN. Julian ChangeLog libgomp/ * plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_exec_params, GOMP_OFFLOAD_openacc_async_exec_params): New functions. --- libgomp/ChangeLog.openacc | 5 +++++ libgomp/plugin/plugin-gcn.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index a187ebb7295..80d089f49e2 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,8 @@ +2019-08-08 Julian Brown + + * plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_exec_params, + GOMP_OFFLOAD_openacc_async_exec_params): New functions. + 2019-07-31 Julian Brown * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Use relative diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index b059348c7bf..6eaae66c1a9 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -3291,6 +3291,14 @@ GOMP_OFFLOAD_openacc_exec (void (*fn_ptr) (void *), size_t mapnum, NULL); } +void +GOMP_OFFLOAD_openacc_exec_params (void (*fn_ptr) (void *), size_t mapnum, + void **hostaddrs, void **devaddrs, + unsigned *dims, void *targ_mem_desc) +{ + GOMP_PLUGIN_fatal ("OpenACC exec params unimplemented."); +} + void GOMP_OFFLOAD_openacc_async_exec (void (*fn_ptr) (void *), size_t mapnum, void **hostaddrs, void **devaddrs, @@ -3303,6 +3311,15 @@ GOMP_OFFLOAD_openacc_async_exec (void (*fn_ptr) (void *), size_t mapnum, aq); } +void +GOMP_OFFLOAD_openacc_async_exec_params (void (*fn) (void *), size_t mapnum, + void **hostaddrs, void **devaddrs, + unsigned *dims, void *targ_mem_desc, + struct goacc_asyncqueue *aq) +{ + GOMP_PLUGIN_fatal ("OpenACC async exec params unimplemented."); +} + struct goacc_asyncqueue * GOMP_OFFLOAD_openacc_async_construct (int device) { From patchwork Thu Aug 8 16:53: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: 1144121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-506530-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="RSS90TJn"; 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 464Dx76Bqfz9sBF for ; Fri, 9 Aug 2019 02:54:18 +1000 (AEST) 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-type:content-transfer-encoding; q=dns; s= default; b=G30MDC4Pyl+V/ptQR9L05ZFz9yHNm9idkJMs8K7ED1HWODXD6aWXk XsVsvHdn1nooB2Pqgy/CbYcQ2Scgo+Bgr6ex0LndpgcczmPMBoXFwnsyNeDBuu9M V9rbbws7KLuvnWU8vH9lednAhbDBAqVRzW5l3Iao+itHN3zFIOXrG4= 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-type:content-transfer-encoding; s=default; bh=Mr3vADIytvmw6QRcmF83E4C5o9U=; b=RSS90TJni/e/MmwwBh6ifme8Frxp 52KUuinEXO2oThUPMp/QsTs/ISgnTl4eK4gF/BncNBGQUCSUDExJZGjHcxyBWtbR fV+JQBT/wvmMuDnVs5PBpuuTf204ssynMEEKcD8jrHrkrqrdNeuc78n7kVqxcyUK cX0KiK9/Wtj2ObE= Received: (qmail 71794 invoked by alias); 8 Aug 2019 16:53:47 -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 71751 invoked by uid 89); 8 Aug 2019 16:53:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Aug 2019 16:53:45 +0000 IronPort-SDR: Fd4teQJxrSxVHSq0vhGPlyfPyYTYvugZKTIVO+bYg5L0egjiXa86lwQbl1WYEKygMViOLQqNcw 2Ipq9ANXnBrewEiAO+gBiD4+CgdSl7cj+m0WTcPVmTXMaJVri0xWT4RjHdIKuECCrHpfzgnljO SwHNYqTJTKN8jFYqE8yOxpfEiA+qvU/KMXkacJ9vu5uCzccdawkBb2WlNTREOrd6ekcknIxCQv ivIpHEvAvupm4u2XQjED2uTkrnIQN1lX8acN05qYWx9B8N3zbcRMT5b9qdwZeTO2b2CLIijg8p jLA= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 08 Aug 2019 08:53:27 -0800 IronPort-SDR: 6WIjlkVVHGdtfGwYdrYXoSnQzBiDovQTYqMl1aK2n6XM8+GFsM3JKzzbxfhRtwNmPOodF+xJzj rktn5IHDNR96EDTKSJjByzytfm8tyd8csJ2p8nesjJUnym7GIyswAsyJN5fuhETh6Mbs1Tt/SU +1mSyK6xGKdAUDV6nhfEqq+5N58JkU0J48HzYUAE/eIAjHCE6c0dSTZPiarf3UfCO5DWuHC5KG AMWXazn7FR2Qh9YCacfSVyaubyoSHo5PONl86HkhsNYva4eQacS2oSx6Eb+T3WIWJAuYmsxSq/ 8n0= From: Julian Brown To: CC: Andrew Stubbs , Jakub Jelinek Subject: [PATCH 2/3] [og9] Fix configury for AMD GCN testing Date: Thu, 8 Aug 2019 09:53:06 -0700 Message-ID: <20190808165307.56375-3-julian@codesourcery.com> In-Reply-To: <20190808165307.56375-1-julian@codesourcery.com> References: <20190808165307.56375-1-julian@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch updates the configury for AMD GCN for version of the patch "Forward -foffload=[...] from the driver (compile-time) to libgomp (run-time)" currently applied to the og9 branch. This is necessary for OpenACC testing on AMD GCN to work properly, at least in our test environment. Julian ChangeLog libgomp/ * plugin/configfrag.ac (amdgcn): Set tgt_plugin. * testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type): Add AMD GCN support. (check_effective_target_openacc_amdgcn_accel_selected): Test offload_target instead of offload_target_openacc. * testsuite/libgomp.oacc-c++/c++.exp (amdgcn*): Rename stanza to... (gcn): ...this. Don't set tagopt redundantly here. * testsuite/libgomp.oacc-c/c.exp (amdgcn*, gcn): Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp (amdgcn*, gcn): Likewise. * configure: Regenerated. --- libgomp/ChangeLog.openacc | 13 +++++++++++++ libgomp/configure | 1 + libgomp/plugin/configfrag.ac | 1 + libgomp/testsuite/lib/libgomp.exp | 7 +++++-- libgomp/testsuite/libgomp.oacc-c++/c++.exp | 3 +-- libgomp/testsuite/libgomp.oacc-c/c.exp | 3 +-- libgomp/testsuite/libgomp.oacc-fortran/fortran.exp | 3 +-- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/libgomp/ChangeLog.openacc b/libgomp/ChangeLog.openacc index 80d089f49e2..62c56e3bf92 100644 --- a/libgomp/ChangeLog.openacc +++ b/libgomp/ChangeLog.openacc @@ -1,3 +1,16 @@ +2019-08-08 Julian Brown + + * plugin/configfrag.ac (amdgcn): Set tgt_plugin. + * testsuite/lib/libgomp.exp (offload_target_to_openacc_device_type): + Add AMD GCN support. + (check_effective_target_openacc_amdgcn_accel_selected): Test + offload_target instead of offload_target_openacc. + * testsuite/libgomp.oacc-c++/c++.exp (amdgcn*): Rename stanza to... + (gcn): ...this. Don't set tagopt redundantly here. + * testsuite/libgomp.oacc-c/c.exp (amdgcn*, gcn): Likewise. + * testsuite/libgomp.oacc-fortran/fortran.exp (amdgcn*, gcn): Likewise. + * configure: Regenerated. + 2019-08-08 Julian Brown * plugin/plugin-gcn.c (GOMP_OFFLOAD_openacc_exec_params, diff --git a/libgomp/configure b/libgomp/configure index 39da8af4546..85a29c5b5e1 100755 --- a/libgomp/configure +++ b/libgomp/configure @@ -15781,6 +15781,7 @@ rm -f core conftest.err conftest.$ac_objext \ ;; *) tgt_name=gcn + tgt_plugin=gcn PLUGIN_GCN=$tgt PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS" diff --git a/libgomp/plugin/configfrag.ac b/libgomp/plugin/configfrag.ac index 6fedd28eccc..1ea67c913ba 100644 --- a/libgomp/plugin/configfrag.ac +++ b/libgomp/plugin/configfrag.ac @@ -256,6 +256,7 @@ if test x"$enable_offload_targets" != x; then ;; *) tgt_name=gcn + tgt_plugin=gcn PLUGIN_GCN=$tgt PLUGIN_GCN_CPPFLAGS=$HSA_RUNTIME_CPPFLAGS PLUGIN_GCN_LDFLAGS="$HSA_RUNTIME_LDFLAGS" diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 19bee806fb0..9644176da2a 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -316,6 +316,9 @@ proc offload_target_to_openacc_device_type { offload_target } { nvptx* { return "nvidia" } + amdgcn* { + return "gcn" + } default { error "Unknown offload target: $offload_target" } @@ -463,8 +466,8 @@ proc check_effective_target_openacc_amdgcn_accel_selected { } { if { ![check_effective_target_openacc_amdgcn_accel_present] } { return 0; } - global offload_target_openacc - if { [string match "amdgcn*" $offload_target_openacc] } { + global offload_target + if { [string match "amdgcn*" $offload_target] } { return 1; } return 0; diff --git a/libgomp/testsuite/libgomp.oacc-c++/c++.exp b/libgomp/testsuite/libgomp.oacc-c++/c++.exp index 1285a6a1c6d..86aacff0c37 100644 --- a/libgomp/testsuite/libgomp.oacc-c++/c++.exp +++ b/libgomp/testsuite/libgomp.oacc-c++/c++.exp @@ -111,9 +111,8 @@ if { $lang_test_file_found } { set acc_mem_shared 0 } - amdgcn* { + gcn { set acc_mem_shared 0 - set tagopt "-DACC_DEVICE_TYPE_gcn=\"$offload_target_openacc\"" } default { error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)" diff --git a/libgomp/testsuite/libgomp.oacc-c/c.exp b/libgomp/testsuite/libgomp.oacc-c/c.exp index f7005ebba48..9ab68bbef14 100644 --- a/libgomp/testsuite/libgomp.oacc-c/c.exp +++ b/libgomp/testsuite/libgomp.oacc-c/c.exp @@ -72,9 +72,8 @@ foreach offload_target [concat [split $offload_targets ":"] "disable"] { set acc_mem_shared 0 } - amdgcn* { + gcn { set acc_mem_shared 0 - set tagopt "-DACC_DEVICE_TYPE_gcn=\"$offload_target_openacc\"" } default { error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)" diff --git a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp index 0f8d1db4895..e36fb15c1ca 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ b/libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -90,9 +90,8 @@ if { $lang_test_file_found } { set acc_mem_shared 0 } - amdgcn* { + gcn { set acc_mem_shared 0 - set tagopt "-DACC_DEVICE_TYPE_gcn=\"$offload_target_openacc\"" } default { error "Unknown OpenACC device type: $openacc_device_type (offload target: $offload_target)" From patchwork Thu Aug 8 16:53:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 1144122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-506531-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="lOv1t69u"; 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 464DxM3Wtkz9sBF for ; Fri, 9 Aug 2019 02:54:31 +1000 (AEST) 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-type:content-transfer-encoding; q=dns; s= default; b=kDKTtxewYAiZbCy8m7soImuRfK/LmCezSD2sWS6jpn8jgZjNsULs6 dSJ9yVOQPCGBZYoY1DOsMAAP6y5CxT+5RZidjpXtYDLAxKyojrvDkjMHYGR6Du5L QrJha2b5TxLedqjzY02bwWYOeEqtjhhava1nkLUL87w6XmfLT2R7ow= 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-type:content-transfer-encoding; s=default; bh=S/v/evNnWF+Mr677OhdRlf6kitU=; b=lOv1t69uZyYop1/DwbG9a4gP2MbX CKV77nReQbISWJm0hycCcQByNY5XUH+iPz+YhQI8hCO8swMqJZ2K/jfo3DK/TtER L/Drxz8WT50xR/ITG4kR/zkxTQ5lXVx1fiLiY3BBBB3G8z5u/Vk0vS9AyrFJXfGO lwQvZ+HvocRKHdc= Received: (qmail 72101 invoked by alias); 8 Aug 2019 16:53:50 -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 72049 invoked by uid 89); 8 Aug 2019 16:53:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: esa2.mentor.iphmx.com Received: from esa2.mentor.iphmx.com (HELO esa2.mentor.iphmx.com) (68.232.141.98) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Aug 2019 16:53:47 +0000 IronPort-SDR: OshzVc9pWeDTCN7h8h7tCFSkpbdnzaRs5NefmpwmogsUaOw3gRfeRPl1MJcSXWLMbTd+GIvvzc JjXQaFl8oeeiCx1DKFDwlRZUpIBbXiXoMt1ZDdwEkZb6YYkuPjebFCEjQ7S+J/LjgoKDTSYtu7 L4ck2WpOIgA1ib6LUZGJtSj9inuiLQbYOrpAzKPUJj8gIwaVJu1BPF04sp1aNl6NfTcTLOE8wj rMSSgqPw4ag4FgoQb01RigJozYjENtlMVgwBAbChKfJGOqrODsovQSsT11/4bbXaWA747Zao2j gJ4= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 08 Aug 2019 08:53:30 -0800 IronPort-SDR: 9wa+PADmcRu+JXzFA6FkMgpp7ZiH0rRT0u31tVSCj/EKdmGZs6vRKrpESpj8rqnztsMSEAUYt/ EI2igzyXKxEDIAh+gtYI3NOKCkCh/S5ZLRGKsHEUk2bjJEKZHW0vbaWgFg6aG2QOKqyqtxlEEk BZN3m0/qKEV16OVU4dKUXK2VYyQ0h6RcGpvWQYVdDcSPZBEEA32b7cOEApgBtXwQPGLONkXWAs NddVAL0Gtvo7in97TEdPYKwt4xlPxUCRN9QQuFzRjxD+w7frieQ5yvsVgIHSoKF0fJneUHSpfB G70= From: Julian Brown To: CC: Andrew Stubbs , Jakub Jelinek Subject: [PATCH 3/3] [og9] Use a single worker for OpenACC on AMD GCN Date: Thu, 8 Aug 2019 09:53:07 -0700 Message-ID: <20190808165307.56375-4-julian@codesourcery.com> In-Reply-To: <20190808165307.56375-1-julian@codesourcery.com> References: <20190808165307.56375-1-julian@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes 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 + + * 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 * 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 + + * plugin/plugin-gcn.c (gcn_exec): Use 1 for the default number of + workers. + 2019-08-08 Julian Brown * 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",