-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[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
[Flang][OpenMP] Add OpenMP standards support doc #132707
Conversation
flang/docs/OpenMPStandardsSupport.md
Outdated
| target teams distribute parallel loop construct | P | | | ||
| teams distribute parallel loop simd construct | P | | | ||
| target teams distribute parallel loop simd construct | P | | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am conservatively marking all target-related constructs (including combined ones) as Partial support. I can correct the entries if they are fully supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together Kiran.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tblah for the quick review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor suggestions
flang/docs/OpenMPStandardsSupport.md
Outdated
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth putting in a date here, so there is some indication of how valid this sentence is?
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. It will be extended later for OpenMP 4.5, OpenMP 5.* and OpenMP 6.0. |
Are we working on support for OpenMP > 4.0? If so, perhaps the second sentence could be rephrased to better reflect this. Perhaps
We are actively working towards supporting OpenMP 4.5, OpenMP 5.* and OpenMP 6.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we working on support for OpenMP > 4.0?
Yes. Some might be working already. Just that I have not spent time characterising the support.
Your suggestions look good. Have made the change.
flang/docs/OpenMPStandardsSupport.md
Outdated
- **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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another optional rephrase (if I understand your intent correctly)
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for compiling this. I am okay with the list and their current status.
Are we not adding task
construct though?
I think we are missing taskgroup as well. |
These came in OpenMP 3.0/3.1. Or do you mean there is something unsupported that you want to report? |
Okay understood. I think we want to say we support OpenMP 4.0 + additional features which we list in the table. I got confused with the line "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" |
flang/docs/OpenMPStandardsSupport.md
Outdated
--- | ||
``` | ||
|
||
This document summarizes OpenMP standards support in Flang. The information is only provided as a guideline. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document summarizes OpenMP standards support in Flang. The information is only provided as a guideline. The | |
This document summarizes the supported features of the OpenMP API in Flang. The information is only provided as a guideline. The |
(OpenMP is not a standard in the true sense, like with the ISO standards.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be OK to go with OpenMP specification?
This document summarizes the supported features of the OpenMP specification in Flang
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
flang/docs/OpenMPStandardsSupport.md
Outdated
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that it has been requested to have a date in the document, but I would treat the modification date of the file in the commit log as being more accurate than the date in the document that could easily be missed when updating the file (plus, it does not protect us from the document becoming outdated over time).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that https://clang.llvm.org/docs/OpenMPSupport.html has split OpenMP support into C/C++ & Fortran already. Presumably it makes sense to either fully join those documents, or remove the Fortran side from the clang docs, and just add a reference to this document.
Also typo
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. | |
As of March 2025, standards support is provided up to OpenMP 4.0. We are actively working towards supporting OpenMP 4.5, OpenMP 5.* and OpenMP 6.0. |
From the table below, OpenMP 4.0 support is not 100% complete yet, so maybe "up to" gives a wrong impression here; I'd read it as "4.0 support is fully implemented".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that https://clang.llvm.org/docs/OpenMPSupport.html has split OpenMP support into C/C++ & Fortran already. Presumably it makes sense to either fully join those documents, or remove the Fortran side from the clang docs, and just add a reference to this document.
Would it be all right to address this separately? Ideally, each Frontend should list its OpenMP support separately. Removing the entry from Clang would require a separate set of reviewers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrote the statement regarding standards support.
Changing the support statement in Clang docs is out of scope for this PR.
flang/docs/OpenMPStandardsSupport.md
Outdated
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these corner cases be made explicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Precise OpenMP standards support information is being documented in llvm#132707 Flang now has good support for OpenMP Version 3.1 and earlier.
Precise OpenMP standards support information is being documented in #132707 Flang now has good support for OpenMP Version 3.1 and earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm excited to see this, thanks for adding it! This will close an old issue of mine :)
flang/docs/OpenMPStandardsSupport.md
Outdated
- **P** : When the implementation is incomplete for a few cases | ||
- **Y** : When the implementation is complete | ||
- **N** : When the implementation is absent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to explain that this is Yes/No/Partial (presumably)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
flang/docs/OpenMPStandardsSupport.md
Outdated
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that https://clang.llvm.org/docs/OpenMPSupport.html has split OpenMP support into C/C++ & Fortran already. Presumably it makes sense to either fully join those documents, or remove the Fortran side from the clang docs, and just add a reference to this document.
Also typo
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. | |
As of March 2025, standards support is provided up to OpenMP 4.0. We are actively working towards supporting OpenMP 4.5, OpenMP 5.* and OpenMP 6.0. |
From the table below, OpenMP 4.0 support is not 100% complete yet, so maybe "up to" gives a wrong impression here; I'd read it as "4.0 support is fully implemented".
OpenMP standard -> OpenMP API specify corner cases for atomic, threadprivate Nit spellings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Kiran. Just one minor nit.
flang/docs/OpenMPSupport.md
Outdated
|
||
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
292a350
to
3230516
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
For any target
construct we don't support the device
clause. For distribute
we don't support dist_schedule
. For teams
, we don't fully support reduction
(e.g. no declare reduction
).
I plan to submit this PR early next week if there are no objections. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for this.
No description provided.