From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) by sourceware.org (Postfix) with ESMTPS id 470373858C5E; Thu, 23 Feb 2023 16:20:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 470373858C5E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=troutmask.apl.washington.edu Authentication-Results: sourceware.org; spf=none smtp.mailfrom=troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.17.1/8.17.1) with ESMTPS id 31NGKJN0066149 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 23 Feb 2023 08:20:19 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.17.1/8.17.1/Submit) id 31NGKJTi066148; Thu, 23 Feb 2023 08:20:19 -0800 (PST) (envelope-from sgk) Date: Thu, 23 Feb 2023 08:20:19 -0800 From: Steve Kargl To: Damian Rouson Cc: Tobias Burnus , fortran , gcc-patches , varma datla Subject: Re: Willing to contribute to =?utf-8?Q?the?= =?utf-8?Q?_project_Idea_=22Fortran_=E2=80=93?= DO CONCURRENT" Message-ID: Reply-To: sgk@troutmask.apl.washington.edu References: <17ddcd30-2e60-5397-433e-e974559515d6@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Feb 23, 2023 at 07:24:26AM -0800, Damian Rouson wrote: > I wonder if a relatively easy starting point would be enabling the > declaration of do concurrent construct variables: > > do concurrent (integer :: i = 1:n) > > It’s a minor convenience and less exciting than adding locality specifiers > but possibly a good first exercise. > > > Damian I've already implemented 95% of the above. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96255 Unfortunately, the last 5% will take me too much time, which I don't have at the moment. Problems arise from the parsing of an iterator is shared by do current, forall, implied-do, and good old do-loops. For the first 3, 'i' is a control variable and is a statement entity (i.e., in the namespace of construct). To do a type spec in one of these cleanly, it would be prudent to either define a namespace for the construct or to use a shadow variable. The shadow variablei, which I was leaning towards, would replace the above with something like do concurrent (integer :: _i = 1:n) '_i' cannot conflict 'i', but this requires walking the execution block of the construct and replacing 'i' with '_i'. Perhaps, starting with the patch in PR96255 would be gentle intro to gfortran hacking. -- Steve