This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82400] [openacc, nvptx] Use ptx atomic operators for reductions
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Oct 2017 12:05:58 +0000
- Subject: [Bug target/82400] [openacc, nvptx] Use ptx atomic operators for reductions
- Auto-submitted: auto-generated
- References: <bug-82400-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82400
--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> The scheme is the same for all operators, using the compare-and-swap atomic
> ptx instruction (atom.cas).
>
> However, some of the operators are supported natively for the ptx:
> ...
> .op = { .and, .or, .xor, .cas, .exch, .add, .inc, .dec, .min, .max };
> ...
> so for f.i. addition we could use an atom.add instead.
[ As implied by the nvptx_reduction_update todo: optimize for atomic ops and
independent complex ops. ]