The syntax of the tile construct is as follows:

#pragma omp tile sizes(size-list) new-line

loop-nest

where loop-nest is a canonical loop nest and size-list is a list s_{1},…,s_{n} of positive integer expressions.

| **OPENMP API Specification: Version 5.1 November 2020**

A loop transformation construct replaces itself, including its associated loop nest, with a structured block that may be another loop nest. If the loop transformation construct is nested inside another loop nest, its replacement becomes part of that loop nest and therefore its generated loops may become associated with another loop-associated directive that forms an enclosing construct. A loop transformation construct that is closely nested within another loop transformation construct applies before the enclosing loop transformation construct.

The associated loop nest of a loop transformation construct must have canonical loop nest form (see Section 2.11.1). All generated loops have canonical loop nest form, unless otherwise specified. Loop iteration variables of generated loops are always private in the enclosing teams, parallel, simd, or task generating construct.

- Canonical loop nest form, see Section 2.11.1.

Summary The tile construct tiles one or more loops.

The syntax of the tile construct is as follows:

!$omp tile sizes(size-list)

loop-nest

[!$omp end tile]

where loop-nest is a canonical loop nest and size-list is a list s_{1},…,s_{n} of positive integer expressions.

If an end tile directive is not specified, an end tile directive is assumed at the end of the do-loops.

Description
The tile construct controls the outer n loops of the associated loop nest, where n is the number of items
in size-list. Let ℓ_{1}, …ℓ_{n} be the associated loops, from outermost to innermost, which the construct replaces
with a loop nest that consists of 2n perfectly nested loops. Let f_{1},…,f_{n},t_{1},…,t_{n} be the generated loops,
from outermost to innermost. The loops f_{1},…,f_{n} are the floor loops and the loops t_{1},…,t_{n} are the tile
loops. The tile loops do not have canonical loop nest form.

Let Ω be the logical iteration vector space of the associated loops. For any (α_{1},…,α_{n}) ∈ ℕ^{n}, define a tile
T_{α1,…,αn} as the set of iterations {(i_{1},…,i_{n}) ∈ Ω∣∀k ∈{1,…,n} : s_{k}α_{k} ≤ i_{k} < s_{k}α_{k} + s_{k}} and
F = {T_{α1,…,αn}∣T_{α1,…,αn}≠∅} as the set of tiles with at least one iteration. Tiles that contain ∏
_{k=1}^{n}s_{k}
iterations are complete tiles. Otherwise, they are partial tiles.

The floor loops iterate over all tiles {T_{α1,…,αn} ∈ F} in lexicographic order with respect to their indices
(α_{1},…,α_{n}) and the tile loops iterate over the iterations in T_{α1,…,αn} in the lexicographic order of the
corresponding iteration vectors. An implementation may reorder the sequential execution of two iterations if
at least one is from a partial tile and if their respective logical iteration vectors in loop-nest do not have a
product order relation.

Restrictions Restrictions to the tile construct are as follows:

- The depth of the associated loop nest must be greater than or equal to n.
- All loops that are associated with the construct must be perfectly nested.
- No loop that is associated with the construct may be a non-rectangular loop.

- Canonical loop nest form, see Section 2.11.1.
- Worksharing-loop construct, see Section 2.11.4.
- distribute construct, see Section 2.11.6.1.
- taskloop construct, see Section 2.12.2.

Summary The unroll construct fully or partially unrolls a loop.

The syntax of the unroll construct is as follows:

!$omp unroll [clause]

loop-nest

[!$omp end unroll]

where loop-nest is a canonical loop nest and clause is one of the following:

full

partial[(unroll-factor)]

where unroll-factor is a positive integer expression that is a compile-time constant.

If an end unroll directive is not specified, an end unroll directive is assumed at the end of the do-loop.

Description The unroll construct controls the outermost loop of the loop nest.

When the full clause is specified, the associated loop is fully unrolled – it is replaced with n instances of its loop body, one for each logical iteration of the associated loop and in the order of its logical iterations. The construct is replaced by a structured block that only contains the n loop body instances.

When the partial clause is specified, the associated loop is first tiled with a tile size of unroll-factor. Then, the generated tile loop is fully unrolled. If the partial clause is used without an unroll-factor argument then the unroll factor is a positive integer that is implementation defined.

When neither the full nor the partial clauses are specified, if and how the loop is unrolled is implementation defined.

The unroll construct results in a generated loop that has canonical loop nest form if and only if the partial clause is specified.

Restrictions Restrictions to the unroll construct are as follows:

- If the full clause is specified, the iteration count of the loop must be a compile-time constant.