-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[Flang][OpenMP] Allow copyprivate and nowait on the directive clauses #127769
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
Thirumalai-Shaktivel
merged 8 commits into
llvm:main
from
Thirumalai-Shaktivel:llvm/single_01
Mar 7, 2025
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
50cdcf6
[Flang][OpenMP] Allow copyprivate and nowait on the directive clauses
Thirumalai-Shaktivel 2ebb099
[Flang] Remove semantic checks for Copyprivate and nowait
Thirumalai-Shaktivel 656864e
Fix failures
Thirumalai-Shaktivel 6cbaf66
Remove duplicate checks
Thirumalai-Shaktivel eebd6c6
Fix Copyprivate clause semantics check
Thirumalai-Shaktivel 292203e
Add a test
Thirumalai-Shaktivel 5168d4e
Fix clang format
Thirumalai-Shaktivel 87b7aac
Fix: Allow nowait only once
Thirumalai-Shaktivel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp -fopenmp-version=52 | ||
! | ||
! OpenMP Version 5.2 | ||
! | ||
! 2.10.2 single Construct | ||
! Copyprivate and Nowait clauses are allowed in both clause and end clause | ||
|
||
subroutine omp_single | ||
integer, save :: i | ||
integer :: j | ||
i = 10; j = 11 | ||
|
||
!ERROR: COPYPRIVATE variable 'i' is not PRIVATE or THREADPRIVATE in outer context | ||
!ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive | ||
!$omp single copyprivate(i) nowait | ||
print *, "omp single", i | ||
!$omp end single | ||
|
||
!$omp parallel private(i) | ||
!$omp single copyprivate(i) | ||
print *, "omp single", i | ||
!$omp end single | ||
!$omp end parallel | ||
|
||
!$omp parallel | ||
!ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive | ||
!$omp single nowait | ||
print *, "omp single", i | ||
!ERROR: COPYPRIVATE variable 'i' is not PRIVATE or THREADPRIVATE in outer context | ||
!$omp end single copyprivate(i) | ||
|
||
!ERROR: COPYPRIVATE variable 'i' is not PRIVATE or THREADPRIVATE in outer context | ||
!$omp single copyprivate(i) | ||
print *, "omp single", i | ||
!ERROR: NOWAIT clause must not be used with COPYPRIVATE clause on the SINGLE directive | ||
!$omp end single nowait | ||
|
||
!ERROR: COPYPRIVATE variable 'j' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct | ||
!$omp single private(j) copyprivate(j) | ||
print *, "omp single", j | ||
!ERROR: At most one COPYPRIVATE clause can appear on the SINGLE directive | ||
!ERROR: COPYPRIVATE variable 'j' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct | ||
!$omp end single copyprivate(j) | ||
|
||
!$omp single nowait | ||
print *, "omp single", j | ||
!ERROR: At most one NOWAIT clause can appear on the SINGLE directive | ||
!$omp end single nowait | ||
!$omp end parallel | ||
|
||
!$omp single nowait | ||
print *, "omp single", i | ||
!$omp end single | ||
end subroutine omp_single |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 condition is incorrect and needs to be tied to the list-items in the
copyprivate
clause. Severalcopyprivate
clauses can be at the directive, as long as they have different list-items.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 missed this, thanks for noticing.
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