Intel® C++ Compiler 16.0 User and Reference Guide
Specifies the beginning of a loop that can be executed concurrently using Single Instruction Multiple Data (SIMD) instructions. Each iteration of the loop is executed by one of the threads in the team.
#pragma omp for 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 |
This pragma converts the associated for loop to a SIMD loop in a way that is consistent with any clauses that apply to the simd construct. The resulting SIMD chunks and any remaining iterations will be distributed across the implicit tasks of the parallel region in a way that is consistent with any clauses that apply to the for construct.
Example: Compiling a loop with SIMD instructions |
---|
#pragma omp for simd schedule(static,10) { for (i=0; i<N; i++) { a[i] = b[i] * c[i]; } } |