From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 868603861802; Tue, 7 Jul 2020 12:39:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 868603861802 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Frederik_Harwath@mentor.com IronPort-SDR: ISxZjSWmqLgMLxO2KfoiyHs3ctZT3tKkmCoNu0FRH+b8g5RtC2GYz+A8GFuKbdlhVLby6l3SId OVD/AvckjC9GjW0ss7Eu1gmNhROJFDmKm145wuqWLwfo3m5mtF/Gev8hGiAJzq6y3kVdbIqwsM Z98txAVyourGdLneY/8/fk2dQiATzuG6YVwFFZEuCpoybtMnTEDzn/mAmeXubkUCEv3TrVE03Z 4tlr2IiAce72xi3bLM63sXdG5CySQkw1ZwSYLLEpjuI5OyV+cAbR9HPBKhItsLP+Vmu7FBytas 9IU= X-IronPort-AV: E=Sophos;i="5.75,323,1589270400"; d="scan'208";a="50651634" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 07 Jul 2020 04:39:28 -0800 IronPort-SDR: 4BFuZ1ShxNaRT7H8H8EC2jAeI/Aygj4Q83tlvi5ZGn8OIXMIVbC6j0dR2ksjB0zyCC9Ih2B16p aEGjA3RdXYh8Xd7aIEy1qmuOKUVC8OFlqVJ7kAbOm+7yt8wWTroofED+p55FmHh4pDtAFnsOOi sjKjnMStkDAwtLcr1KrALqyFmYDlmkygACu4LikpD13yxjoAsxy/DcFStK0WZJHS5KOI817Gna jJ/WJa4HSKfZMfhLDckylmPO8jAwaFMxqT0up9uvjulF/8l3EiUAhx1xURHir5YAWw27slHIAi L6Q= From: Frederik Harwath To: Thomas Schwinge , Julian Brown , Kwok Cheung Yeung CC: , , Tobias Burnus , Jakub Jelinek Subject: Re: [PATCH] [og10] libgomp, Fortran: Fix OpenACC "gang reduction on an orphan loop" error message In-Reply-To: References: <91521931-373f-a3a6-7a3f-1752f08858a1@codesourcery.com> Date: Tue, 7 Jul 2020 14:39:22 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jul 2020 12:39:30 -0000 Thomas Schwinge writes: Hi Thomas, > (CC added, for everything touching gfortran.) Thanks! > On 2020-07-07T10:52:08+0200, Frederik Harwath = wrote: >> This patch fixes the check for reductions on orphaned gang loops > > This is the "Make OpenACC orphan gang reductions errors" functionality > originally added in gomp-4_0-branch r247461. > >> the Fortran frontend which (in contrast to the C, C++ frontends) >> erroneously rejects reductions on gang loops that are contained in >> "kernels" constructs and which hence are not orphaned. >> >> According to the OpenACC standard version 2.5 and later, reductions on >> orphaned gang loops are explicitly disallowed (cf. section "Changes >> from Version 2.0 to 2.5"). Remember that a loop is "orphaned" if it is >> not lexically contained in a compute construct (cf. section "Loop >> construct" of the OpenACC standard), i.e. in either a "parallel", a >> "serial", or a "kernels" construct. > > Or the other way round: a 'loop' construct is orphaned if it appears > inside a 'routine' region, right? The "not lexically contained in a compute construct" definition is from the standard. Assuming that the frontend's parser rejects "loop" directives if they do not occur inside of either the "serial", "parallel", "kernels" compute constructs or in a function with a "routine" directive, both definitions should be indeed equivalent ;-). > Unless Julian/Kwok speak up soon: OK, thanks. > > Reviewed-by: Thomas Schwinge > > May want to remove "libgomp" from the first line of the commit log -- > this commit doesn't relate to libgomp specifically. Right. > (Ideally, we'd also test 'serial' construct in addition to 'kernels', > 'parallel', but we can add that later. I anyway have a WIP patch > waiting, adding more 'serial' construct testing, for a different reason, > so I'll include it there.) I had left this out intentionally, because having the gang reduction in the serial construct leads to a "region contains gang partitioned code but is not gang partitioned" error. Of course, we might still add a test case with that expectation. Thanks for the review! Frederik ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstra=DFe 201, 80634 M=FCnchen / G= ermany Registergericht M=FCnchen HRB 106955, Gesch=E4ftsf=FChrer: Thomas Heurung, = Alexander Walter