[flang-commits] [flang] [Flang][OpenMP] Add OpenMP standards support doc (PR #132707)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Wed Apr 9 09:55:33 PDT 2025


https://github.com/kiranchandramohan updated https://github.com/llvm/llvm-project/pull/132707

>From c48a92166f139d68be834e59028066a40f81d292 Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Mon, 24 Mar 2025 10:32:56 +0000
Subject: [PATCH 1/7] [Flang][OpenMP] Add OpenMP standards support doc

---
 flang/docs/OpenMPStandardsSupport.md | 62 ++++++++++++++++++++++++++++
 flang/docs/index.md                  |  1 +
 2 files changed, 63 insertions(+)
 create mode 100644 flang/docs/OpenMPStandardsSupport.md

diff --git a/flang/docs/OpenMPStandardsSupport.md b/flang/docs/OpenMPStandardsSupport.md
new file mode 100644
index 0000000000000..9942fc8faa608
--- /dev/null
+++ b/flang/docs/OpenMPStandardsSupport.md
@@ -0,0 +1,62 @@
+<!--===- docs/FortranStandardsSupport.md
+
+   Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+   See https://llvm.org/LICENSE.txt for license information.
+   SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+-->
+
+# Flang OpenMP Standards Support
+
+```{contents}
+---
+local:
+---
+```
+
+This document summarizes OpenMP standards support in Flang. The information is only provided as a guideline. The
+TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative.
+Standards support is provided upto OpenMP 4.0 for now. It will be extended later for OpenMP 4.5, OpenMP 5.* and OpenMP 6.0.
+
+The standards support information is provided as a table with three columns that are self explanatory. The Status column uses
+the letters **P**, **Y**, **N** for the implementation status:
+- **P** : When the implementation is incomplete for a few cases
+- **Y** : When the implementation is complete
+- **N** : When the implementation is absent
+
+Note : No distinction is made between the support in the Parser/Semantics, MLIR or Lowering support, and OpenMPIRBuilder support.
+
+## OpenMP 4.0
+
+| Feature                                                    | Status | Comments                                                |
+|------------------------------------------------------------|--------|---------------------------------------------------------|
+| proc_bind clause                                           | Y      | |
+| simd construct                                             | P      | Some clauses are not supported |
+| declare simd construct                                     | N      | |
+| do simd construct                                          | Y      | |
+| target data construct                                      | P      | |
+| target construct                                           | P      | |
+| target update construct                                    | P      | |
+| declare target directive                                   | P      | |
+| teams construct                                            | P      | |
+| distribute construct                                       | P      | |
+| distribute simd construct                                  | P      | |
+| distribute parallel loop construct                         | P      | |
+| distribute parallel loop simd construct                    | P      | |
+| depend clause                                              | P      | Depend clause with array sections are not supported |
+| declare reduction construct                                | N      | |
+| atomic construct extensions                                | Y      | |
+| cancel construct                                           | N      | |
+| cancellation point construct                               | N      | |
+| parallel do simd construct                                 | Y      | |
+| target teams construct                                     | P      | |
+| teams distribute construct                                 | P      | |
+| teams distribute simd construct                            | P      | |
+| target teams distribute construct                          | P      | |
+| teams distribute parallel loop construct                   | P      | |
+| target teams distribute parallel loop construct            | P      | |
+| teams distribute parallel loop simd construct              | P      | |
+| target teams distribute parallel loop simd construct       | P      | |
+
+## OpenMP 3.1, OpenMP 2.5, OpenMP 1.1
+All features except a few corner cases in atomic, copyin constructs/clauses are supported 
diff --git a/flang/docs/index.md b/flang/docs/index.md
index 1de0ee2e6f0d6..9a037812c43ee 100644
--- a/flang/docs/index.md
+++ b/flang/docs/index.md
@@ -29,6 +29,7 @@ on how to get in touch with us and to learn more about the current status.
    GettingInvolved
    GettingStarted
    ImplementingASemanticCheck
+   OpenMPStandardsSupport
    PullRequestChecklist
 ```
 

>From 06f3a9f874a3b2ed427a918e78c5ce0eb3a4dbdc Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Mon, 24 Mar 2025 18:32:44 +0000
Subject: [PATCH 2/7] Address review comment

---
 flang/docs/OpenMPStandardsSupport.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/docs/OpenMPStandardsSupport.md b/flang/docs/OpenMPStandardsSupport.md
index 9942fc8faa608..32fe4ccc0ef77 100644
--- a/flang/docs/OpenMPStandardsSupport.md
+++ b/flang/docs/OpenMPStandardsSupport.md
@@ -16,7 +16,7 @@ local:
 
 This document summarizes OpenMP standards support in Flang. The information is only provided as a guideline. The
 TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative.
-Standards support is provided upto OpenMP 4.0 for now. It will be extended later for OpenMP 4.5, OpenMP 5.* and OpenMP 6.0.
+As of March 2025, standards support is provided upto OpenMP 4.0. We are actively working towards supporting OpenMP 4.5, OpenMP 5.* and OpenMP 6.0.
 
 The standards support information is provided as a table with three columns that are self explanatory. The Status column uses
 the letters **P**, **Y**, **N** for the implementation status:

>From d8b57ea407b0a1ab7e666e1570cb26e32a03565c Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Mon, 24 Mar 2025 23:56:58 +0000
Subject: [PATCH 3/7] Address review comments

---
 flang/docs/OpenMPStandardsSupport.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/docs/OpenMPStandardsSupport.md b/flang/docs/OpenMPStandardsSupport.md
index 32fe4ccc0ef77..0b974c5d2dac7 100644
--- a/flang/docs/OpenMPStandardsSupport.md
+++ b/flang/docs/OpenMPStandardsSupport.md
@@ -24,7 +24,7 @@ the letters **P**, **Y**, **N** for the implementation status:
 - **Y** : When the implementation is complete
 - **N** : When the implementation is absent
 
-Note : No distinction is made between the support in the Parser/Semantics, MLIR or Lowering support, and OpenMPIRBuilder support.
+Note : No distinction is made between the support in Parser/Semantics, MLIR, Lowering or the OpenMPIRBuilder.
 
 ## OpenMP 4.0
 

>From d1e80fb9526b81824f56ff3ca9bd0b5ac1e86c05 Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Wed, 9 Apr 2025 13:45:57 +0100
Subject: [PATCH 4/7] Address review comments

OpenMP standard -> OpenMP API
specify corner cases for atomic, threadprivate
Nit spellings
---
 ...MPStandardsSupport.md => OpenMPSupport.md} | 20 ++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
 rename flang/docs/{OpenMPStandardsSupport.md => OpenMPSupport.md} (73%)

diff --git a/flang/docs/OpenMPStandardsSupport.md b/flang/docs/OpenMPSupport.md
similarity index 73%
rename from flang/docs/OpenMPStandardsSupport.md
rename to flang/docs/OpenMPSupport.md
index 0b974c5d2dac7..cd6861f534f1d 100644
--- a/flang/docs/OpenMPStandardsSupport.md
+++ b/flang/docs/OpenMPSupport.md
@@ -6,7 +6,7 @@
 
 -->
 
-# Flang OpenMP Standards Support
+# Flang OpenMP Support
 
 ```{contents}
 ---
@@ -14,15 +14,17 @@ local:
 ---
 ```
 
-This document summarizes OpenMP standards support in Flang. The information is only provided as a guideline. The
-TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative.
-As of March 2025, standards support is provided upto OpenMP 4.0. We are actively working towards supporting OpenMP 4.5, OpenMP 5.* and OpenMP 6.0.
+This document outlines the OpenMP API features supported by Flang. It is intended as a general reference.
+For the most accurate information on unimplemented features, rely on the compiler’s TODO or “Not Yet Implemented”
+messages, which are considered authoritative. Flang provides full support for OpenMP 3.1 and partial support for
+OpenMP 4.0. The table below details the current support for OpenMP 4.0 features. Work is ongoing to add support
+for OpenMP 4.5 and newer versions; an official support statement for these will be shared in the future.
 
-The standards support information is provided as a table with three columns that are self explanatory. The Status column uses
+The feature support information is provided as a table with three columns that are self explanatory. The Status column uses
 the letters **P**, **Y**, **N** for the implementation status:
-- **P** : When the implementation is incomplete for a few cases
-- **Y** : When the implementation is complete
-- **N** : When the implementation is absent
+- **P** : Partial. When the implementation is incomplete for a few cases
+- **Y** : Yes. When the implementation is complete
+- **N** : No. When the implementation is absent
 
 Note : No distinction is made between the support in Parser/Semantics, MLIR, Lowering or the OpenMPIRBuilder.
 
@@ -59,4 +61,4 @@ Note : No distinction is made between the support in Parser/Semantics, MLIR, Low
 | target teams distribute parallel loop simd construct       | P      | |
 
 ## OpenMP 3.1, OpenMP 2.5, OpenMP 1.1
-All features except a few corner cases in atomic, copyin constructs/clauses are supported 
+All features except a few corner cases in atomic (complex type, different but compatible types in lhs and rhs), threadprivate (character type) constructs/clauses are supported.

>From 97343cda390bb2a8c082b0cfa716a460a108330d Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Wed, 9 Apr 2025 14:13:22 +0100
Subject: [PATCH 5/7] Rename file in index.md

---
 flang/docs/index.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/docs/index.md b/flang/docs/index.md
index 9a037812c43ee..ff14cab683499 100644
--- a/flang/docs/index.md
+++ b/flang/docs/index.md
@@ -29,7 +29,7 @@ on how to get in touch with us and to learn more about the current status.
    GettingInvolved
    GettingStarted
    ImplementingASemanticCheck
-   OpenMPStandardsSupport
+   OpenMPSupport
    PullRequestChecklist
 ```
 

>From 5e07af488b966ea741aaf891e9351c366b16a5b5 Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Wed, 9 Apr 2025 17:45:42 +0100
Subject: [PATCH 6/7] Address comments from Pranav

---
 flang/docs/OpenMPSupport.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/flang/docs/OpenMPSupport.md b/flang/docs/OpenMPSupport.md
index cd6861f534f1d..b25114b760aba 100644
--- a/flang/docs/OpenMPSupport.md
+++ b/flang/docs/OpenMPSupport.md
@@ -16,8 +16,10 @@ local:
 
 This document outlines the OpenMP API features supported by Flang. It is intended as a general reference.
 For the most accurate information on unimplemented features, rely on the compiler’s TODO or “Not Yet Implemented”
-messages, which are considered authoritative. Flang provides full support for OpenMP 3.1 and partial support for
-OpenMP 4.0. The table below details the current support for OpenMP 4.0 features. Work is ongoing to add support
+messages, which are considered authoritative.  With the exception of a few corner cases, Flang
+offers full support for OpenMP 3.1 ([See details here](#OpenMP 3.1, OpenMP 2.5, OpenMP 1.1)).
+Partial support for OpenMP 4.0 is also available and currently under active development. The table below outlines the current status of OpenMP 4.0 feature support.
+The table below details the current support for OpenMP 4.0 features. Work is ongoing to add support
 for OpenMP 4.5 and newer versions; an official support statement for these will be shared in the future.
 
 The feature support information is provided as a table with three columns that are self explanatory. The Status column uses

>From 323051635f8b2ef6146cfd24ab3b2a2b799b40fe Mon Sep 17 00:00:00 2001
From: Kiran Chandramohan <kiran.chandramohan at arm.com>
Date: Wed, 9 Apr 2025 17:50:09 +0100
Subject: [PATCH 7/7] Fix link - attempt 1

---
 flang/docs/OpenMPSupport.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/docs/OpenMPSupport.md b/flang/docs/OpenMPSupport.md
index b25114b760aba..b9faee5e102d6 100644
--- a/flang/docs/OpenMPSupport.md
+++ b/flang/docs/OpenMPSupport.md
@@ -17,7 +17,7 @@ local:
 This document outlines the OpenMP API features supported by Flang. It is intended as a general reference.
 For the most accurate information on unimplemented features, rely on the compiler’s TODO or “Not Yet Implemented”
 messages, which are considered authoritative.  With the exception of a few corner cases, Flang
-offers full support for OpenMP 3.1 ([See details here](#OpenMP 3.1, OpenMP 2.5, OpenMP 1.1)).
+offers full support for OpenMP 3.1 ([See details here](#openmp-31-openmp-25-openmp-11)).
 Partial support for OpenMP 4.0 is also available and currently under active development. The table below outlines the current status of OpenMP 4.0 feature support.
 The table below details the current support for OpenMP 4.0 features. Work is ongoing to add support
 for OpenMP 4.5 and newer versions; an official support statement for these will be shared in the future.



More information about the flang-commits mailing list