Would it be easier to consider "DO CONCURRENT with LOCAL / LOCAL_INIT" as a 
special case of !$OMP PARALLEL DO, so utilise this existing implementation ?

John Campbell

-----Original Message-----
From: Damian Rouson <damian@archaeologic.codes> 
Sent: Sunday, 26 January 2025 9:38 AM
To: Tobias Burnus <tbur...@baylibre.com>
Cc: Jerry D <jvdelis...@gmail.com>; Andre Vehreschild <ve...@gmx.de>; 
fortran@gcc.gnu.org
Subject: Re: DO CONCURRENT with LOCAL / LOCAL_INIT [was: [PATCH] Fortran: Added 
support for locality specs in DO CONCURRENT (Fortran 2018/23)]

In case it helps anyone to see how significant the reduction in complexity can 
be with support for locality specifiers, we have Fortran 2008, 2018, and 2023 
versions of the "do concurrent" construct that lies at the heart of our 
neural-network training code here:

https://github.com/BerkeleyLab/fiats/blob/25457d8e390f59f3191d6fcd0d5a609f173059d6/src/fiats/neural_network_s.F90#L899

The 2023 version has one do concurrent statement that we expand into 7 
statements if we have to fall back to 2018 (including the "end block"
that is much lower in the code) without reduce locality and expands to
10 statements if we have to fall all the way back to 2008 without local or 
reduce.  Although there's a minor win associated with supporting local, there's 
a much bigger reduction in code complexity that comes with supporting both 
local and reduce.

Damian

Reply via email to