This PR follows suit of the Extensions.md document and provides the same file for OpenMP API extensions. These have previously been stored in OpenMPSupport.md. Having a more centralized view and place for these extensions seems useful. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1.8 KiB
1.8 KiB
(openmp-extensions)=
OpenMP API Extensions Supported by Flang
See also {doc}OpenMPSupport for a general overview of OpenMP support in Flang.
---
local:
---
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.