-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Flang][OpenMP][Semantics] Modify errors to warnings for semantic checks in IS_DEVICE_PTR related to list-items being dummy arguments. #74370
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
Merged
Changes from all commits
Commits
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
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.
According to the restriction, this error should be reported right? It says argument must be a dummy argument. Am I missing something?
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 think this restriction is something on the lines of "If the list-item in an is_device_ptr clause is a dummy argument it should not have ALLOCATABLE, POINTER or VALUE attributes."
I think this following text might not have completely meant that all list-items must be dummy arguments only I think the conjunction of "does not have the ALLOCATABLE, POINTER or VALUE attribute" might be the reason for the "must".
A list item that appears in an is_device_ptr clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
Also, this restriction is not present from OpenMP 5.1 onwards through which I assumed it might not be originally intended for OpenMP spec committee might not have intended to restricted list-item of is_device_ptr clause to be dummy argument only.
Please correct me if I am interpreting it incorrectly. :)
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.
So it seems like the type of list item became more restrictive as the standard progressed.
OpenMP 4.5 standard (2.10.4):
A list item that appears in an is_device_ptr clause must be a dummy argument
OpenMP 5.0 standard (2.12.5):
A list item that appears in an is_device_ptr clause must be a dummy argument that does not have the ALLOCATABLE, POINTER or VALUE attribute.
However, my understanding of both these statements is leaning similar to @shraiysh's- any list item in this clause has to be a dummy argument, but without any additional attributes from ALLOCATABLE, POINTER, VALUE. In other words, I don't think non-dummy arguments are allowed in this clause. This becomes clear when we look at the OpenMP 4.5 standard wording: it is, without a doubt, restricting all list items within the clause to be dummy arguments.
Uh oh!
There was an error while loading. Please reload this page.
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.
Like Raghu mentioned, I cannot find this check, or anything related to the c_ptr being a dummy argument in the OpenMP 5.2 spec. If this check is not required in 5.2, we probably should remove this check completely - please let me know if there is anything related to this in 5.2. As discussed in the meeting, OpenMP 5.2 is essentially a fix on OpenMP 5.1 and OpenMP 5.0, so we should stick to OpenMP 5.2.
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 asked @mjklemm who is CEO of OpenMP ARB
Here are his comments:
@mjklemm : 5.0 is broken. 5.1/5.2 has fixed it. OpenMP 6.0 will have a different behavior. I wonder if it would make sense to directly implement the 5.2 and 6.0 behavior.
This aligns with @shraiysh 's comment. Even I could not find anything related to dummy argument list item of IS_DEVICE_PTR clause. So, I will remove the dummy argument check.
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 think in 5.2 we deprecate all the other use of the is_device_ptr clause in Fortran except
type(c_ptr)
variables in order to avoid any confusion between pointer and nonpointer list item. The has_device_address clause should be the choice for Fortran unless it is atype(c_ptr)
variable.In Section 5.4.7, we have:
In my opinion, issuing a warning message about the use being deprecated is good for the users. Furthermore, I don't think the spec wants to add more Fortran stuff to the is_device_ptr clause as it creates so much confusion in the past.
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 followed all your review comments and updated my patch. Can you please review? Thanks!