OpenMP API Extensions Supported by Flang¶
See also Flang OpenMP Support for a general overview of OpenMP support in Flang.
The Flang compiler supports several extensions to OpenMP API features, providing enhanced parallelism and data management capabilities for Fortran applications. This document outlines the supported extensions and their usage within Flang.
Supported OpenMP API Extensions¶
The following extensions are supported by Flang.
ATOMIC Construct¶
The implementation of the ATOMIC construct follows OpenMP 6.0 with the following extensions:
x = xis an allowed form of ATOMIC UPDATE. This is motivated by the fact that the equivalent formsx = x+0orx = x*1are allowed.Explicit type conversions are allowed in ATOMIC READ, WRITE or UPDATE constructs, and in the capture statement in ATOMIC UPDATE CAPTURE. The OpenMP spec requires intrinsic- or pointer-assignments, which include (as per the Fortran standard) implicit type conversions. Since such conversions need to be handled, allowing explicit conversions comes at no extra cost.
A literal
.true.or.false.is an allowed condition in ATOMIC UPDATE COMPARE. [1]A logical variable is an allowed form of the condition even if its value is not computed within the ATOMIC UPDATE COMPARE construct [1].
expr equalop xis an allowed condition in ATOMIC UPDATE COMPARE. [1]
Data-sharing Clauses and Directives¶
Using
COMMONblock variables in anEQUIVALENCEstatement inTHREADPRIVATEdirectives.
[1] Code generation for ATOMIC UPDATE COMPARE is not implemented yet.