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

5.4.6  linear Clause

Name: linear

Properties: data-environment attribute, data-sharing attribute, privatization, post-modified

Arguments

Name

Type

Properties

list

list of variable list item type

default

Modifiers

Name

Modifies

Type

Properties

step-simple-modifier

list

OpenMP integer expression

exclusive, region-invariant, unique

step-complex-modifier

list

Complex, name: step Arguments:

linear-step

expression of integer type (region-invariant)

unique

linear-modifier

list

Keyword: ref, uval, val

unique

Directives

declare simd, do, for, simd

Additional information

list and linear-modifier may instead be specified as linear-modifier(list) for linear clauses that appear on a declare simd directive. This syntax has been deprecated.

Semantics

The linear clause provides a superset of the functionality provided by the private clause. A list item that appears in a linear clause is subject to the private clause semantics described in Section 5.4.3, except as noted. If the step-simple-modifier is specified, the behavior is as if the step-complex-modifier is instead specified with step-simple-modifier as its linear-step argument. If linear-step is not specified, it is assumed to be 1.

When a linear clause is specified on a construct, the value of the new list item on each logical iteration of the associated loops corresponds to the value of the original list item before entering the construct plus the logical number of the iteration times linear-step. The value corresponding to the sequentially last logical iteration of the associated loops is assigned to the original list item.

When a linear clause is specified on a declare simd directive, the list items refer to parameters of the procedure to which the directive applies. For a given call to the procedure, the clause determines whether the SIMD version generated by the directive may be called. If the clause does not specify the ref linear-modifier, the SIMD version requires that the value of the corresponding argument at the callsite is equal to the value of the argument from the first lane plus the logical number of the lane times the linear-step. If the clause specifies the ref linear-modifier, the SIMD version requires that the storage locations of the corresponding arguments at the callsite from each SIMD lane correspond to locations within a hypothetical array of elements of the same type, indexed by the logical number of the lane times the linear-step.

Restrictions

Restrictions to the linear clause are as follows:

Cross References