Intel® C++ Compiler 16.0 User and Reference Guide

omp parallel for simd

Specifies a parallel region that contains a loop to execute with Single Instruction Multiple Data (SIMD) instructions.

Syntax

#pragma omp parallel for simd [clause[, clause, ...]]

for-loop

Arguments

clause

Can be any of the following:

  • copyin(list)

  • default(shared | none)

  • firstprivate(list)

  • if(scalar-expression)

  • num_threads(integer expression)

  • private(list)

  • reduction(operator:list)

  • shared(list)

for loop

Must be in the following form:

for (init-expr; test-expr; incr-expr)

structured-block

Description

This pragma is a shortcut for a parallel region that contains a single SIMD loop construct.

Example: Compiling with SIMD instructions in a parallel loop with a simple for loop

#pragma omp parallel for simd schedule(static,10) {
  for (i=0; i<N; i++) { a[i] = b[i] * c[i]; }
}