HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

7.4  Metadirectives

A metadirective is a directive that can specify multiple directive variants of which one may be conditionally selected to replace the metadirective based on the enclosing OpenMP context. A metadirective is replaced by a nothing directive or one of the directive variants specified by the when clauses or the otherwise clause. If no otherwise clause is specified the effect is as if one was specified without an associated directive variant.

The OpenMP context for a given metadirective is defined according to Section 7.1. The order of clauses that appear on a metadirective is significant and otherwise must be the last clause specified on a metadirective.

Replacement candidates are ordered according to the following rules in decreasing precedence:

The list of dynamic replacement candidates is the prefix of the sorted list of replacement candidates up to and including the first candidate for which the corresponding when clause has a static context selector. The first dynamic replacement candidate for which the corresponding when clause has a compatible context selector, according to the matching rules defined in Section 7.3, replaces the metadirective.

Restrictions

Restrictions to metadirectives are as follows:

  7.5.2  adjust_args Clause
  7.5.3  append_args Clause
  7.5.4  declare variant Directive
  7.5.5  begin declare variant Directive