public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/100753] New: Implement in_reduction clause on target construct
@ 2021-05-25 11:20 jakub at gcc dot gnu.org
  2021-06-28  9:46 ` [Bug libgomp/100753] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-25 11:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100753
           Summary: Implement in_reduction clause on target construct
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

I think we have two cases.

One is in_reduction clause on synchronous target (i.e. without nowait clause),
I think that is implementable just by calling GOMP_task_reduction_remap on all
map clause addresses that use the in_reduction identifier as base expression
and making sure map clause isn't thrown away for them when the original list
item is declare target to - the in_reduction clause acts as a privatization
clause on the target task.  Plus add map(always, tofrom: item) clause.

The much harder case is target with nowait clause.  Right now task reductions
are implemented by having privatized arrays with one element per thread.  But
for async target the host threads can be doing something else and can update
those private copies.
So I think for nowait in_reduction(...) we need to create new host private
copies for those (initialized with the reduction initializers), map them to
device and when the target task is over, map them back from device and at that
point combine them into the remapped private reduction var.  That will probably
mean a new callback invoked from GOMP_PLUGIN_target_task_completion ?

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

* [Bug libgomp/100753] Implement in_reduction clause on target construct
  2021-05-25 11:20 [Bug libgomp/100753] New: Implement in_reduction clause on target construct jakub at gcc dot gnu.org
@ 2021-06-28  9:46 ` jakub at gcc dot gnu.org
  2021-06-28 13:51 ` burnus at gcc dot gnu.org
  2021-10-20 17:06 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-28  9:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Partly implemented in r12-1768-g7619d33471c10fe3d149dcbb701d99ed3dd23528
In particular the in_reduction without nowait is implemented and for nowait
there is a hack - presence of in_reduction acts as if nowait wasn't present.
That is hopefully valid, but certainly not desirable state, so extra work is
needed to make it work efficiently.

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

* [Bug libgomp/100753] Implement in_reduction clause on target construct
  2021-05-25 11:20 [Bug libgomp/100753] New: Implement in_reduction clause on target construct jakub at gcc dot gnu.org
  2021-06-28  9:46 ` [Bug libgomp/100753] " jakub at gcc dot gnu.org
@ 2021-06-28 13:51 ` burnus at gcc dot gnu.org
  2021-10-20 17:06 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-06-28 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Additionally missing: Fortran support.

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

* [Bug libgomp/100753] Implement in_reduction clause on target construct
  2021-05-25 11:20 [Bug libgomp/100753] New: Implement in_reduction clause on target construct jakub at gcc dot gnu.org
  2021-06-28  9:46 ` [Bug libgomp/100753] " jakub at gcc dot gnu.org
  2021-06-28 13:51 ` burnus at gcc dot gnu.org
@ 2021-10-20 17:06 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-10-20 17:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #2)
> Additionally missing: Fortran support.
Fortran support was implemented in
r12-4574-gd98626bf451dea6a28a42d953f7d0bd7659ad4d5

Still to do: Proper nowait support as described above.

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

end of thread, other threads:[~2021-10-20 17:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 11:20 [Bug libgomp/100753] New: Implement in_reduction clause on target construct jakub at gcc dot gnu.org
2021-06-28  9:46 ` [Bug libgomp/100753] " jakub at gcc dot gnu.org
2021-06-28 13:51 ` burnus at gcc dot gnu.org
2021-10-20 17:06 ` burnus at gcc dot gnu.org

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).