[OpenACC][OpenMP] Document atomic-in-teams extensionThat is, put D126323 in the status doc and explain its relationship toOpenACC support.Reviewed By: jdoerfertDifferential Revision: https://r
[OpenACC][OpenMP] Document atomic-in-teams extensionThat is, put D126323 in the status doc and explain its relationship toOpenACC support.Reviewed By: jdoerfertDifferential Revision: https://reviews.llvm.org/D126547
show more ...
[OpenMP][OpenACC] Implement `ompx_hold` map type modifier extension in Clang (1/2)This patch implements Clang support for an original OpenMP extensionwe have developed to support OpenACC: the `omp
[OpenMP][OpenACC] Implement `ompx_hold` map type modifier extension in Clang (1/2)This patch implements Clang support for an original OpenMP extensionwe have developed to support OpenACC: the `ompx_hold` map typemodifier. The next patch in this series, D106510, implements OpenMPruntime support.Consider the following example:``` #pragma omp target data map(ompx_hold, tofrom: x) // holds onto mapping of x { foo(); // might have map(delete: x) #pragma omp target map(present, alloc: x) // x is guaranteed to be present printf("%d\n", x); }```The `ompx_hold` map type modifier above specifies that the `targetdata` directive holds onto the mapping for `x` throughout theassociated region regardless of any `target exit data` directivesexecuted during the call to `foo`. Thus, the presence assertion for`x` at the enclosed `target` construct cannot fail. (As usual, thestandard OpenMP reference count for `x` must also reach zero beforethe data is unmapped.)Justification for inclusion in Clang and LLVM's OpenMP runtime:* The `ompx_hold` modifier supports OpenACC functionality (structured reference count) that cannot be achieved in standard OpenMP, as of 5.1.* The runtime implementation for `ompx_hold` (next patch) will thus be used by Flang's OpenACC support.* The Clang implementation for `ompx_hold` (this patch) as well as the runtime implementation are required for the Clang OpenACC support being developed as part of the ECP Clacc project, which translates OpenACC to OpenMP at the directive AST level. These patches are the first step in upstreaming OpenACC functionality from Clacc.* The Clang implementation for `ompx_hold` is also used by the tests in the runtime implementation. That syntactic support makes the tests more readable than low-level runtime calls can. Moreover, upstream Flang and Clang do not yet support OpenACC syntax sufficiently for writing the tests.* More generally, the Clang implementation enables a clean separation of concerns between OpenACC and OpenMP development in LLVM. That is, LLVM's OpenMP developers can discuss, modify, and debug LLVM's extended OpenMP implementation and test suite without directly considering OpenACC's language and execution model, which can be handled by LLVM's OpenACC developers.* OpenMP users might find the `ompx_hold` modifier useful, as in the above example.See new documentation introduced by this patch in `openmp/docs` formore detail on the functionality of this extension and itsrelationship with OpenACC. For example, it explains how the runtimemust support two reference counts, as specified by OpenACC.Clang recognizes `ompx_hold` unless `-fno-openmp-extensions`, a newcommand-line option introduced by this patch, is specified.Reviewed By: ABataev, jdoerfert, protze.joachim, grokosDifferential Revision: https://reviews.llvm.org/D106509