diff --git a/clang/docs/OpenMPSupport.rst b/clang/docs/OpenMPSupport.rst index 1292af07a8e41..88e3050d3622c 100644 --- a/clang/docs/OpenMPSupport.rst +++ b/clang/docs/OpenMPSupport.rst @@ -369,9 +369,12 @@ documentation are provided. As these extensions mature, they will be considered for standardization. Please contact *openmp-dev* at *lists.llvm.org* to provide feedback. -+------------------------------+---------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+ -|Category | Feature | Status | Reviews | -+==============================+===========================================================================+==========================+========================================================+ -| device extension | `'ompx_hold' map type modifier | :good:`prototyped` | D106509, D106510 | -| | `_ | | | -+------------------------------+---------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+ ++------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+ +|Category | Feature | Status | Reviews | ++==============================+===================================================================================+==========================+========================================================+ +| atomic extension | `'atomic' strictly nested within 'teams' | :good:`prototyped` | D126323 | +| | `_ | | | ++------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+ +| device extension | `'ompx_hold' map type modifier | :good:`prototyped` | D106509, D106510 | +| | `_ | | | ++------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+ diff --git a/openmp/docs/openacc/OpenMPExtensions.rst b/openmp/docs/openacc/OpenMPExtensions.rst index bc662c32e81ca..82cf77548b9a0 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++;