mirror-llvm-project/flang/docs/OpenACC.md
Andre Kuhlenschmidt 4628cbd042
[flang][openacc] add optional extension to allow default none scalars (#197718)
Adds the flag, `-facc-allow-default-none-scalars`. When this flag is
enabled, Flang reverts to the pre-3.2 behavior: scalar variables
referenced inside a `default(none)` compute region without an explicit
data clause do not produce an error. Instead, Flang infers implicit data
attributes for those scalars via the same implicit-copy logic applied in
regions without `default(none)`.

- Adds tests and documentation.
- Makes an explicit extensions doc for OpenACC to mirror the OpenMP
extensions doc.
- Moves the intentional deviations to from the standard to the
extensions doc.
2026-05-18 20:46:51 +00:00

1.2 KiB
Raw Permalink Blame History

OpenACC in Flang

---
local:
---

Intentional deviation from the specification

See OpenACC-extensions.md for the full list of extensions supported by Flang. Flang also adds the following restrictions:

  • The OpenACC specification does not prohibit the same variable from appearing in multiple data clauses, but this is disallowed for variables appearing in reduction clauses.
  • The OpenACC specification does not prohibit the same variable from appearing multiple times in a use_device clause on a host_data construct, but this is disallowed.

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.