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

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