Skip to content

[Flang][OpenMP] Add OpenMP standards support doc #132707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
64 changes: 64 additions & 0 deletions flang/docs/OpenMPSupport.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!--===- 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 Support

```{contents}
---
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Like you mention in the section on previous standards (<=3.1) there are some, albeit very few, corner cases that are not supported. I think this line here is then misleading; it'll make a reader believe 3.1 is fully supported and chances are he won't bother to scroll down to the section below to find info about the corner cases. Perhaps consider something like, but not necessary exactly, the following

Aside from very few corner cases, Flang provides full support for OpenMP 3.1 [See detail here](#OpenMP 3.1,-OpenMP 2.5,-OpenMP-1.1). There is also partial (in development) support for OpenMP 4.0

(Note: I may have got the link syntax wrong especially around the use of commas).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks.

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 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** : 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.

## 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 (complex type, different but compatible types in lhs and rhs), threadprivate (character type) constructs/clauses are supported.
1 change: 1 addition & 0 deletions flang/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on how to get in touch with us and to learn more about the current status.
GettingInvolved
GettingStarted
ImplementingASemanticCheck
OpenMPSupport
PullRequestChecklist
```

Expand Down