diff options
author | Joel E. Denny <jdenny.ornl@gmail.com> | 2022-05-27 18:53:19 -0400 |
---|---|---|
committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2022-05-27 18:53:19 -0400 |
commit | 4a368136693ba9c4e827702e9d390280c3d5e7ac (patch) | |
tree | af1fbd1262f4af7c91f83ba53ec63955129422c1 /openmp/docs | |
parent | 85b4470035b74834dcba3be14e8abb530f302caa (diff) | |
download | llvm-4a368136693ba9c4e827702e9d390280c3d5e7ac.tar.gz |
[OpenACC][OpenMP] Document atomic-in-teams extension
That is, put D126323 in the status doc and explain its relationship to
OpenACC support.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D126547
Diffstat (limited to 'openmp/docs')
-rw-r--r-- | openmp/docs/openacc/OpenMPExtensions.rst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/openmp/docs/openacc/OpenMPExtensions.rst b/openmp/docs/openacc/OpenMPExtensions.rst index bc662c32e81c..82cf77548b9a 100644 --- a/openmp/docs/openacc/OpenMPExtensions.rst +++ b/openmp/docs/openacc/OpenMPExtensions.rst @@ -137,3 +137,36 @@ selecting OpenMP reference counts, the implementation is the same at the runtime level. That is, OpenACC's dynamic reference count is OpenMP's dynamic reference count, and OpenACC's structured reference count is our OpenMP hold reference count extension. + +.. _atomicWithinTeams: + +``atomic`` Strictly Nested Within ``teams`` +------------------------------------------- + +Example +^^^^^^^ + +OpenMP 5.2, sec. 10.2 "teams Construct", p. 232, L9-12 restricts what +regions can be strictly nested within a ``teams`` region. As an +extension, Clang relaxes that restriction in the case of the +``atomic`` construct so that, for example, the following case is +permitted: + +.. code-block:: c++ + + #pragma omp target teams map(tofrom:x) + #pragma omp atomic update + x++; + +Relationship with OpenACC +^^^^^^^^^^^^^^^^^^^^^^^^^ + +This extension is important when translating OpenACC to OpenMP because +OpenACC does not have the same restriction for its corresponding +constructs. For example, the following is conforming OpenACC: + +.. code-block:: c++ + + #pragma acc parallel copy(x) + #pragma acc atomic update + x++; |