Flang OpenMP Support

---
local:
---

This document outlines the OpenMP API features supported by Flang. It is intended as a general reference. For the most accurate information on unimplemented features, rely on the compiler’s TODO or “Not Yet Implemented” messages, which are considered authoritative. With the exception of a few corner cases, Flang offers full support for OpenMP 3.1 (See details here). Partial support for OpenMP 4.0 is also available and currently under active development. The table below outlines the current status of OpenMP 4.0 feature support. Work is ongoing to add support for OpenMP 4.5 and newer versions; a support statement for these will be shared in the future. The table entries are derived from the information provided in the Version Differences subsection of the Features History section in the OpenMP standard.

The feature support information is provided as a table with three columns that are self explanatory. The Status column uses the letters P, Y, N for the implementation status:

  • P : Partial. When the implementation is incomplete for a few cases
  • Y : Yes. When the implementation is complete
  • N : No. When the implementation is absent

Note : No distinction is made between the support in Parser/Semantics, MLIR, Lowering or the OpenMPIRBuilder.

OpenMP 4.0

FeatureStatusComments
proc_bind clauseY
simd constructPlinear clause is not supported
declare simd constructN
do simd constructPlinear clause is not supported
target data constructPdevice clause not supported
target constructPdevice clause not supported
target update constructPdevice clause not supported
declare target directiveP
teams constructPreduction clause not supported
distribute constructPdist_schedule clause not supported
distribute simd constructPdist_schedule and linear clauses are not supported
distribute parallel loop constructPdist_schedule clause not supported
distribute parallel loop simd constructPdist_schedule and linear clauses are not supported
depend clausePdepend clause with array sections are not supported
declare reduction constructN
atomic construct extensionsY
cancel constructN
cancellation point constructN
parallel do simd constructPlinear clause is not supported
target teams constructPdevice and reduction clauses are not supported
teams distribute constructPreduction and dist_schedule clauses not supported
teams distribute simd constructPreduction, dist_schedule and linear clauses are not supported
target teams distribute constructPdevice, reduction and dist_schedule clauses are not supported
teams distribute parallel loop constructPreduction and dist_schedule clauses are not supported
target teams distribute parallel loop constructPdevice, reduction and dist_schedule clauses are not supported
teams distribute parallel loop simd constructPreduction, dist_schedule, and linear clauses are not supported
target teams distribute parallel loop simd constructPdevice, reduction, dist_schedule and linear clauses are not supported

OpenMP 3.1, OpenMP 2.5, OpenMP 1.1

All features except a few corner cases in atomic (complex type, different but compatible types in lhs and rhs), threadprivate (character type) constructs/clauses are supported.