public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/96898] [nvptx] libatomic support
Date: Fri, 04 Sep 2020 16:57:42 +0000	[thread overview]
Message-ID: <bug-96898-4-FdFcUsS5cH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96898-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> For OpenMP reductions, we really don't care what kind of mutex protects the
> updates, as long as it is the same for all updates of the same reduction.
> I believe we don't rely on any other synchronization effects.
> So, I think we should change omp-low.c so that it emits __atomic_* calls
> with __ATOMIC_RELAXED rather than __sync_* calls.

That sounds like a good idea.

> And could just use
> libatomic with its own locking if we didn't go the GOMP_atomic_{start,end}
> route (that one is done if there are multiple reductions or the atomics
> aren't available or there are user defined reductions we don't understand
> (or all?), perhaps we should consider also using atomics perhaps even for
> two simple reductions or similar.
> And nvptx certainly could just use libatomic...

If we use libatomic as fallback for openmp, shouldn't we then use the same lock
in both?

  parent reply	other threads:[~2020-09-04 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 11:41 [Bug target/96898] New: " vries at gcc dot gnu.org
2020-09-03 13:02 ` [Bug target/96898] " vries at gcc dot gnu.org
2020-09-04  8:08 ` vries at gcc dot gnu.org
2020-09-04  8:45 ` jakub at gcc dot gnu.org
2020-09-04 16:57 ` vries at gcc dot gnu.org [this message]
2020-09-04 17:11 ` jakub at gcc dot gnu.org
2020-09-07 22:17 ` vries at gcc dot gnu.org
2020-09-07 22:50 ` vries at gcc dot gnu.org
2020-09-08  6:52 ` vries at gcc dot gnu.org
2020-09-11 10:08 ` cvs-commit at gcc dot gnu.org
2020-09-11 10:18 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-96898-4-FdFcUsS5cH@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).