User-Mandated or SIMD Vectorization
- A variable may belong to zero or one of the following: private, linear, or reduction.
- Within the vector loop, an expression is evaluated as a vector value if it is private, linear, reduction, or it has a sub-expression that is evaluated to a vector value. Otherwise, it is evaluated as a scalar value (that is, broadcast the same value to all iterations). Scalar value does not necessarily mean loop invariant, although that is the most frequently seen usage pattern of scalar value.
- A vector value may not be assigned to a scalar L-value. It is an error.
- A scalar L-value may not be assigned under a vector condition. It is an error.
- Theswitchstatement is not supported.
Restrictions on Using
a #pragma omp declare simd declaration
- Thread creation and joining through, OpenMP*, and explicit threading API calls.parallel/for/sections/task/target/teams
- Locks, barriers, atomic construct, critical sections (These are allowed inside#pragma omp ordered simdblocks).
- Inline ASM code, VM and Vector Intrinsics (for example, SVML intrinsics).
- Using setjmp, longjmp, SHE and computedGOTO.
- EH is not allowed and all vector functions are considered noexcept.
- Theswitchstatement (in some cases this may be supported and converted toifstatements, but this is not reliable).
- (un)signed 8, 16, 32, or 64-bit integer
- 32- or 64-bit floating point
- 64- or 128-bit complex
- A pointer (C++ reference is considered a pointer data type)