The OpenACC standard specifies an atomic construct in section 2.12
(of 3.3 spec), used to ensure that a specific location is accessed or
updated atomically. Four different clauses are allowed: read, write,
update, or capture. If no clause appears, it is as if update
is used.
The OpenMP specification defines the same clauses for omp atomic. The
types of expression and the clauses in the OpenACC spec match the OpenMP
spec exactly. The main difference is that the OpenMP specification is a
superset - it includes clauses for hint and memory order. It also
allows conditional expression statements. But otherwise, the expression
definition matches.
Thus, for OpenACC, we reuse the OpenMP implementation as follows:
- The dialect operations are duplicated and the not needed parts removed
(hint and memory order). The goal is no dependence or coupling between
the two dialects so they can continue to evolve without hindrance from
the other. - The verification operations are also duplicated with the
not needed parts removed. This part could possibly be shared by having a
common verifier pieces that are templated. Having it shared could be
beneficial when fixing errors or adding further constraints - the
disadvantage is that it would introduce some coupling on design.
The frontend lowering necessary to generate the dialect can be reused.
This will be done in a follow up change.
What is the use of these? I don't see any use in the lowering as well. Same question for the other ops.