OpenMP Clauses

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

Provides links to clauses used in the OpenMP API.

Visual C++ supports the following OpenMP clauses:

ClauseDescription
copyinAllows threads to access the master thread's value, for a threadprivate variable.
copyprivateSpecifies that one or more variables should be shared among all threads.
defaultSpecifies the behavior of unscoped variables in a parallel region.
firstprivateSpecifies that each thread should have its own instance of a variable, and that the variable should be initialized with the value of the variable, because it exists before the parallel construct.
ifSpecifies whether a loop should be executed in parallel or in serial.
lastprivateSpecifies that the enclosing context's version of the variable is set equal to the private version of whichever thread executes the final iteration (for-loop construct) or last section (#pragma sections).
nowaitOverrides the barrier implicit in a directive.
num_threadsSets the number of threads in a thread team.
orderedRequired on a parallel for statement if an ordered directive is to be used in the loop.
privateSpecifies that each thread should have its own instance of a variable.
reductionSpecifies that one or more variables that are private to each thread are the subject of a reduction operation at the end of the parallel region.
scheduleApplies to the for directive.
sharedSpecifies that one or more variables should be shared among all threads.

OpenMP
Directives

Show: