[Openmp-commits] [PATCH] D126547: [OpenACC][OpenMP] Document atomic-in-teams extension

Joel E. Denny via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri May 27 08:03:06 PDT 2022


jdenny created this revision.
jdenny added reviewers: ABataev, jdoerfert, clementval.
jdenny added projects: OpenMP, OpenACC.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
jdenny requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

That is, put D126323 <https://reviews.llvm.org/D126323> in the status doc and explain its relationship to
OpenACC support.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126547

Files:
  clang/docs/OpenMPSupport.rst
  openmp/docs/openacc/OpenMPExtensions.rst


Index: openmp/docs/openacc/OpenMPExtensions.rst
===================================================================
--- openmp/docs/openacc/OpenMPExtensions.rst
+++ openmp/docs/openacc/OpenMPExtensions.rst
@@ -137,3 +137,36 @@
 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++;
Index: clang/docs/OpenMPSupport.rst
===================================================================
--- clang/docs/OpenMPSupport.rst
+++ clang/docs/OpenMPSupport.rst
@@ -369,9 +369,12 @@
 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                                       |
-|                              | <https://openmp.llvm.org/docs/openacc/OpenMPExtensions.html#ompx-hold>`_  |                          |                                                        |
-+------------------------------+---------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
++------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
+|Category                      | Feature                                                                           | Status                   | Reviews                                                |
++==============================+===================================================================================+==========================+========================================================+
+| atomic extension             | `'atomic' strictly nested within 'teams'                                          | :good:`prototyped`       | D126323                                                |
+|                              | <https://openmp.llvm.org/docs/openacc/OpenMPExtensions.html#atomicWithinTeams>`_  |                          |                                                        |
++------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+
+| device extension             | `'ompx_hold' map type modifier                                                    | :good:`prototyped`       | D106509, D106510                                       |
+|                              | <https://openmp.llvm.org/docs/openacc/OpenMPExtensions.html#ompx-hold>`_          |                          |                                                        |
++------------------------------+-----------------------------------------------------------------------------------+--------------------------+--------------------------------------------------------+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126547.432562.patch
Type: text/x-patch
Size: 4571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220527/57d94f04/attachment.bin>


More information about the Openmp-commits mailing list