Intel® C++ Compiler 16.0 User and Reference Guide
Transforms the loop into a loop that will be executed concurrently using Single Instruction Multiple Data (SIMD) instructions.
#pragma omp simd [clause[, clause ...]] |
for-loops
clause |
Can be any of the following clauses:
|
for loop |
Must be in the following form: for (init-expr; test-expr; incr-expr) structured-block |
The simd construct enables the execution of multiple iterations of the associated loops concurrently by means of SIMD instructions. The integer used in the collapse clause indicates how many loops are associated with the simd construct. If the nocollapse clause is present, then only the immediately following loop is associated. No intervening code or OpenMP* constructs may appear between the for-loops.
Example: Creating two loops with SIMD instructions |
---|
#pragma omp simd collapse(2) for(i=0; i<N; i++) { a[i] = b[i] * c[i]; for(i=0; i<N; i++) { d[i] = e[i] * f[i]; } } |