[Bug target/96898] [nvptx] libatomic support

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Sep 4 08:45:14 GMT 2020


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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.  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...


More information about the Gcc-bugs mailing list