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

DECLARE SIMD

OpenMP* Fortran Compiler Directive: Generates a SIMD procedure.

!$OMP DECLARE SIMD(routine-name) [clause[[,] clause]... ]

routine-name

Is the name of a routine (a function or subroutine). It cannot be a generic name; it must be a specific name. It also cannot be a procedure pointer or an entry name.

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. 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.

  • INBRANCH | NOTINBRANCH

    The INBRANCH clause specifies that the routine must always be called from inside a conditional statement of a SIMD loop.

    The NOTINBRANCH clause specifies that the routine must never be called from inside a conditional statement of a SIMD loop.

    If neither clause is specified, then the routine may or may not be called from inside a conditional statement of a SIMD loop.

    You can only specify INBRANCH or NOTINBRANCH; you cannot specify both.

  • 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 clause or another LINEAR clause.

  • REDUCTION (operator : list)

  • SIMDLEN(n)

    Specifies the number of concurrent arguments (n) for the SIMD version of routine-name. Then must be a constant positive integer expression.

    If SIMDLEN is not specified, the number of concurrent arguments for the routine-name is implementation defined.

    Only one SIMDLEN clause can appear in a DECLARE SIMD directive.

  • UNIFORM(list)

    Tells the compiler that the values of the specified arguments have an invariant value for all concurrent invocations of the routine in the execution of a single SIMD loop.

    The list is one or more scalar variables that are dummy arguments in the specified routine.

    Multiple UNIFORM clauses are merged as a union.

The DECLARE SIMD construct enables the creation of SIMD versions of the specified subroutine or function. You can use multiple DECLARE SIMD constructs in a single procedure to produce more than one SIMD version of a procedure. These versions can be used to process multiple arguments from a single invocation from a SIMD loop concurrently.

When routine-name is executed, it cannot have any side-effects that would change its execution for concurrent iterations of a SIMD chunk. When the routine is called from a SIMD loop, it cannot cause the execution of any OpenMP* Fortran construct.

If a DECLARE SIMD directive is specified for a routine name with explicit interface and for the definition of the routine, they must match. Otherwise, the result is unspecified.

You cannot use procedure pointers to access routines created by the DECLARE SIMD directive.

You can only specify a particular variable in at most one instance of a UNIFORM or LINEAR clause.

関連情報


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