public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop
@ 2022-06-16 16:50 wileamyp at outlook dot com
  2022-06-17  7:22 ` [Bug fortran/106005] (F2023) Support for REDUCE " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: wileamyp at outlook dot com @ 2022-06-16 16:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

            Bug ID: 106005
           Summary: (F2023) Support for REDUCTION clause in DO CONCURRENT
                    loop
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wileamyp at outlook dot com
  Target Milestone: ---

GFortran 12.1.0 refuses to compile the following valid code under Fortran 2023.

$ cat dc-reduce.f90

PROGRAM dcreduce
  INTEGER, PARAMETER :: n = 10
  INTEGER :: ivec(n)
  ivec = [( i, i = 1, n )]
  ival = 0
  DO CONCURRENT (i=1:n) REDUCE(+:ival)
    ival = ival + ivec(i)
  END DO
  PRINT *, ival
END PROGRAM

$ gfortran --version
GNU Fortran (Spack GCC) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gfortran dc-reduce.f90
dc-reduce.f90:7:24:

    7 |   DO CONCURRENT (i=1:n) REDUCE(+:ival)
      |                        1
Error: Syntax error in DO statement at (1)
dc-reduce.f90:9:5:

    9 |   END DO
      |     1
Error: Expecting END PROGRAM statement at (1)

At the time of writing, only NVIDIA nvfortran compiles this successfully and
gives the correct result. Tested with nvfortran 22.5.

$ nvfortran --version

nvfortran 22.5-0 64-bit target on x86-64 Linux -tp zen2 
NVIDIA Compilers and Tools
Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.

$ nvfortran dc-reduce.f90
$ ./a.out 
           55

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/106005] (F2023) Support for REDUCE clause in DO CONCURRENT loop
  2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
@ 2022-06-17  7:22 ` kargl at gcc dot gnu.org
  2022-06-17 14:31 ` wileamyp at outlook dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2022-06-17  7:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org ---
Why would you expect gfortran to support a non-existent Fortran standard?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/106005] (F2023) Support for REDUCE clause in DO CONCURRENT loop
  2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
  2022-06-17  7:22 ` [Bug fortran/106005] (F2023) Support for REDUCE " kargl at gcc dot gnu.org
@ 2022-06-17 14:31 ` wileamyp at outlook dot com
  2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: wileamyp at outlook dot com @ 2022-06-17 14:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

--- Comment #2 from Wileam Yonatan Phan <wileamyp at outlook dot com> ---
Wait, I thought the committee is ready to vote on it? I've seen the draft of
the summary paper by Reid linked from here:
<https://gcc.gnu.org/wiki/GFortranStandards#Fortran_202x>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/106005] (F2023) Support for REDUCE clause in DO CONCURRENT loop
  2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
  2022-06-17  7:22 ` [Bug fortran/106005] (F2023) Support for REDUCE " kargl at gcc dot gnu.org
  2022-06-17 14:31 ` wileamyp at outlook dot com
@ 2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
  2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2022-06-17 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Jun 17, 2022 at 02:31:20PM +0000, wileamyp at outlook dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005
> 
> --- Comment #2 from Wileam Yonatan Phan <wileamyp at outlook dot com> ---
> Wait, I thought the committee is ready to vote on it? I've seen the draft of
> the summary paper by Reid linked from here:
> <https://gcc.gnu.org/wiki/GFortranStandards#Fortran_202x>
> 

Everything you said is correct.  The committee is ready to vote,
but it is still a none existent standard.  The first thing required
for gfortran to support any F2023 feature would be the addition of
a -std=2023.  This has not been implemented, yet.

I'll also note that things don't magically appear in gfortran.
Someone has to implement it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/106005] (F2023) Support for REDUCE clause in DO CONCURRENT loop
  2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
                   ` (2 preceding siblings ...)
  2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
@ 2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
  2022-06-17 14:56 ` wileamyp at outlook dot com
  2022-06-17 16:41 ` sgk at troutmask dot apl.washington.edu
  5 siblings, 0 replies; 7+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2022-06-17 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Jun 17, 2022 at 02:31:20PM +0000, wileamyp at outlook dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005
> 
> --- Comment #2 from Wileam Yonatan Phan <wileamyp at outlook dot com> ---
> Wait, I thought the committee is ready to vote on it? I've seen the draft of
> the summary paper by Reid linked from here:
> <https://gcc.gnu.org/wiki/GFortranStandards#Fortran_202x>
> 

Everything you said is correct.  The committee is ready to vote,
but it is still a none existent standard.  The first thing required
for gfortran to support any F2023 feature would be the addition of
a -std=2023.  This has not been implemented, yet.

I'll also note that things don't magically appear in gfortran.
Someone has to implement it.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/106005] (F2023) Support for REDUCE clause in DO CONCURRENT loop
  2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
                   ` (3 preceding siblings ...)
  2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
@ 2022-06-17 14:56 ` wileamyp at outlook dot com
  2022-06-17 16:41 ` sgk at troutmask dot apl.washington.edu
  5 siblings, 0 replies; 7+ messages in thread
From: wileamyp at outlook dot com @ 2022-06-17 14:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

--- Comment #5 from Wileam Yonatan Phan <wileamyp at outlook dot com> ---
Hi Steve,

I think I recognize you from the Fortran-lang Discourse forum!

> The committee is ready to vote, but it is still a non-existent standard.

That's technically true, since the votes haven't been cast, yet.

> The first thing required for gfortran to support any F2023 feature would be the addition of a -std=f2023.  This has not been implemented, yet.

That is correct, and I guess work on implementing the `-std=f2023` flag will
start as soon as the standard is agreed upon and published. Do you know when
the committee will meet to vote?

> I'll also note that things don't magically appear in gfortran. Someone has to implement it.

Hopefully I will be able to implement this particular part (REDUCE) as part of
my GSoC '22 project
<https://summerofcode.withgoogle.com/programs/2022/projects/et1mX1zU>. The
second phase of the project specifically addresses support in the parser, and
the third phase implements the actual parallelization.

So, my intention on filing this bug is to have a public record for tracking my
project's progress. I'll also periodically blog about it at
<https://wyphan.github.io> and
<https://fortran-lang.discourse.group/t/gsoc-2022-accelerating-fortran-do-concurrent-in-gcc/3269>

Wish me luck!

Thanks,
Wil

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/106005] (F2023) Support for REDUCE clause in DO CONCURRENT loop
  2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
                   ` (4 preceding siblings ...)
  2022-06-17 14:56 ` wileamyp at outlook dot com
@ 2022-06-17 16:41 ` sgk at troutmask dot apl.washington.edu
  5 siblings, 0 replies; 7+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2022-06-17 16:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005

--- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Fri, Jun 17, 2022 at 02:56:50PM +0000, wileamyp at outlook dot com wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106005
> 
> --- Comment #5 from Wileam Yonatan Phan <wileamyp at outlook dot com> ---
> Hi Steve,
> 
> I think I recognize you from the Fortran-lang Discourse forum!
> 

Yep.

> > The committee is ready to vote, but it is still a non-existent standard.
> 
> That's technically true, since the votes haven't been cast, yet.
> 
> > The first thing required for gfortran to support any F2023 feature would be the addition of a -std=f2023.  This has not been implemented, yet.
> 
> That is correct, and I guess work on implementing the `-std=f2023` flag will
> start as soon as the standard is agreed upon and published. Do you know when
> the committee will meet to vote?

I've seem some voting in the J3 mailing list, bu that may have
been for interpretation requests against the current standard.
J3 is scheduled to meet in July.  If J3 hasn't passed F2023 to
ISO yet, then it likely will be finalized at this meeting.


> > I'll also note that things don't magically appear in gfortran. Someone has to implement it.
> 
> Hopefully I will be able to implement this particular part (REDUCE) as part of
> my GSoC '22 project
> <https://summerofcode.withgoogle.com/programs/2022/projects/et1mX1zU>. The
> second phase of the project specifically addresses support in the parser, and
> the third phase implements the actual parallelization.
> 
> So, my intention on filing this bug is to have a public record for tracking my
> project's progress. I'll also periodically blog about it at
> <https://wyphan.github.io> and
> <https://fortran-lang.discourse.group/t/gsoc-2022-accelerating-fortran-do-concurrent-in-gcc/3269>
> 

I haven't used DO CURRENT in my own codes so only have a small
amount of exposure to what gfortran does.  I suspect it is 
missing some, if not most, of the locality stuff from F2018.
If you have general questions about gfortran internals, feel
free to ping me.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-17 16:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 16:50 [Bug fortran/106005] New: (F2023) Support for REDUCTION clause in DO CONCURRENT loop wileamyp at outlook dot com
2022-06-17  7:22 ` [Bug fortran/106005] (F2023) Support for REDUCE " kargl at gcc dot gnu.org
2022-06-17 14:31 ` wileamyp at outlook dot com
2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
2022-06-17 14:46 ` sgk at troutmask dot apl.washington.edu
2022-06-17 14:56 ` wileamyp at outlook dot com
2022-06-17 16:41 ` sgk at troutmask dot apl.washington.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).