インテル® Fortran コンパイラー 14.0 ユーザー・リファレンス・ガイド

SIMD Directive (OpenMP* API)

OpenMP* Fortran Compiler Directive: Requires and controls SIMD vectorization of loops.

!$OMP SIMD [clause[[,] clause]... ]

   do-loop

[!$OMP END SIMD]

clause

Is an optional vectorization clause. It can be one or more of the following:

  • ALIGNED (list [: n])

    Specifies that all variables in list are aligned in a DO loop. Any variable that appears in list cannot appear in more than one ALIGNED clause.

    The n must be a constant positive integer expression; it indicates the number of bytes for the alignment. If n is not specified, the compiler uses the default alignment specified for SIMD instructions on the target platform.

    The ALIGNED clause overrides efficiency heuristics in the optimizer. It instructs the compiler to use aligned data movement instructions for all array references. This clause disables all the advanced alignment optimizations of the compiler, such as determining alignment properties from the program context or using dynamic loop peeling to make references aligned.

    Be careful when using the ALIGNED clause. Instructing the compiler to implement all array references with aligned data movement instructions will cause a runtime exception if some of the access patterns are actually unaligned.

  • COLLAPSE (n)

    Specifies how many loops are associated with the loop construct. The n must be a constant positive integer expression. If COLLAPSE is not specified, the only loop that is associated with the loop construct is the one that immediately follows the construct.

    If n is greater than one, the iterations of all associated loops are collapsed into one larger iteration, which is then executed with SIMD instructions. The sequential execution of the iterations in all associated loops determines the order of the iterations in the collapsed iteration. The associated loops must be perfectly nested, that is, there must be no intervening code or any OpenMP directive between any two loops.

    The iteration count for each associated loop is computed before entry to the outermost loop. If execution of any associated loop changes any of the values used to compute any of the iteration counts, then the behavior is unspecified. The integer kind used to compute the iteration count for the collapsed loop is implementation defined.

    Only one COLLAPSE clause can appear in a SIMD directive.

  • LASTPRIVATE (list)

  • LINEAR (var1 [, var2]... [: step])

    var

    Is a scalar variable.

    step

    Is a compile-time positive, integer constant expression.

    For each iteration of a scalar loop, each var is incremented by step. Every iteration of the vector loop increments the variables by VL (vector length)*step. If more than one step is specified for a var, a compile-time error occurs. Multiple LINEAR clauses can be used to specify different values for step.

    A variable in a LINEAR clause cannot appear in a REDUCTION, PRIVATE, or LASTPRIVATE clause, or another LINEAR clause.

  • PRIVATE (list)

  • REDUCTION (operator : list)

  • SAFELEN(n)

    Limits the number of iterations in a SIMD chunk (set of concurrent iterations).

    The n must be a constant positive integer expression; it indicates the number of iterations allowed in a SIMD chunk.

    When this clause is used, no two iterations executed concurrently with SIMD instructions can have a greater distance in the logical iteration space than n.

    The number of iterations that are executed concurrently at any given time is defined by the implementation. Each concurrent iteration is executed by a different SIMD vector lane.

    Only one SAFELEN clause can appear in a SIMD directive.

do-loop

Is one or more DO iterations (DO loops). The DO iteration cannot be a DO WHILE or a DO loop without loop control. The DO loop iteration variable must be of type integer.

All loops associated with the construct must be structured and perfectly nested; that is, there must be no intervening code and no other OpenMP* Fortran directives between any two loops.

The iterations of the DO loop are distributed across the existing team of threads. The values of the loop control parameters of the DO loop associated with a DO directive must be the same for all the threads in the team.

You cannot branch out of a DO loop associated with a SIMD directive.

If used, the END SIMD directive must appear immediately after the end of the loop. If you do not specify an END SIMD directive, an END SIMD directive is assumed at the end of do-loop.

The SIMD construct enables the execution of multiple iterations of the associated loops concurrently by means of SIMD instructions. No other OpenMP* Fortran construct can appear in a SIMD directive.

A SIMD region binds to the current task region. The binding thread set of the SIMD region is the current team.

When any thread encounters a SIMD construct, the iterations of the loop associated with the construct may be executed concurrently using the SIMD lanes that are available to the thread.

関連情報


このヘルプトピックについてのフィードバックを送信