General Compiler Directive: Controls SIMD vectorization of loops.
cDEC$ SIMD [clause[, clause]...]
c |
Is one of the following: C (or c), !, or * (see Syntax Rules for Compiler Directives). |
||||||||||||
clause |
Is an optional vectorization clause. It can be one or more of the following:
|
If you specify the SIMD directive with no clause, default rules are in effect for variable attributes, vector length, and so forth.
You can only specify a particular variable in at most one instance of a PRIVATE, LINEAR, or REDUCTION clause.
If the compiler is unable to vectorize a loop, a warning occurs by default. However, if ASSERT is specified, an error occurs instead.
If the vectorizer has to stop vectorizing a loop for some reason, the fast floating-point model is used for the SIMD loop.
Note that the SIMD directive may not affect all auto-vectorizable loops. Some of these loops do not have a way to describe the SIMD vector semantics.
The following restrictions apply to the SIMD directive:
The countable loop for the SIMD directive has to conform to the DO-loop style of an OpenMP worksharing loop construct. Additionally, the loop control variable must be a signed integer type.
The vector values must be signed 8-, 16-, 32-, or 64-bit integers, single or double-precision floating point numbers, or single or double-precision complex numbers.
A SIMD loop cannot contain another loop in it; no loop nesting is allowed. Note that inlining can create such an inner loop and cause an error, which may not be obvious at the source level.
A SIMD directive loop performs memory references unconditionally. Therefore, all address computations must result in valid memory addresses, even though such locations may not be accessed if the loop is executed sequentially.
To disable the SIMD transformations for vectorization, specify -no-simd (Linux and Mac OS X) or /Qsimd- (Windows).
To disable transformations that enable more vectorization, specify options -no-vec -no-simd (Linux and Mac OS X) or /Qvec- /Qsimd- (Windows).
Consider the following:
...
subroutine add(A, N, X)
integer N, X
real A(N)
cDEC$ SIMD
DO I=X+1, N
A(I) = A(I) + A(I-X)
ENDDO
end
...
When the program containing this subroutine is compiled, the DO loop will be vectorized.
Because no optional clause was specified for the directive, default rules will apply for variable attributes, vector length, and so forth.
Copyright © 1996-2010, Intel Corporation. All rights reserved.