Skip to content

[flang][doc] Added remark about array element references in data clauses. #72332

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 2 commits into from
Nov 21, 2023

Conversation

vzakhari
Copy link
Contributor

…ses.

@llvmbot llvmbot added flang Flang issues not falling into any other category openacc labels Nov 15, 2023
@llvmbot
Copy link
Member

llvmbot commented Nov 15, 2023

@llvm/pr-subscribers-openacc

Author: Slava Zakharin (vzakhari)

Changes

…ses.


Full diff: https://github.com/llvm/llvm-project/pull/72332.diff

1 Files Affected:

  • (modified) flang/docs/OpenACC.md (+7)
diff --git a/flang/docs/OpenACC.md b/flang/docs/OpenACC.md
index 4c36a38f8bf5731..9be6ee2ff4e7832 100644
--- a/flang/docs/OpenACC.md
+++ b/flang/docs/OpenACC.md
@@ -25,3 +25,10 @@ local:
   logical expression.
 * `!$acc routine` directive can be placed at the top level. 
 * `!$acc cache` directive accepts scalar variable.
+
+## Remarks about incompatibilities with other implementations
+* Array element references in the data clauses are equivalent to array sections
+  consisting of this single element, i.e. `copyin(a[n])` is equivalent to
+  `copyin(a[n:n])`.  Some other implementations have treated it as
+  `copyin(a[:n])`, which does not correspond to OpenACC spec – Flang does not
+  support this interpretation of an array element reference.

Copy link
Contributor

@razvanlupusoru razvanlupusoru left a comment

Choose a reason for hiding this comment

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

Thank you for adding this remark!


## Remarks about incompatibilities with other implementations
* Array element references in the data clauses are equivalent to array sections
consisting of this single element, i.e. `copyin(a[n])` is equivalent to
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we use the parenthesis notation instead of brackets for Fortran?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch!

@vzakhari vzakhari merged commit 0d77978 into llvm:main Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category openacc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants