共用方式為


OpenMP Clauses

Provides links to clauses used in the OpenMP API.

Visual C++ supports the following OpenMP clauses:

Clause

Description

copyin

Allows threads to access the master thread's value, for a threadprivate variable.

copyprivate

Specifies that one or more variables should be shared among all threads.

default (OpenMP)

Specifies the behavior of unscoped variables in a parallel region.

firstprivate

Specifies 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.

if (OpenMP)

Specifies whether a loop should be executed in parallel or in serial.

lastprivate

Specifies 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).

nowait

Overrides the barrier implicit in a directive.

num_threads

Sets the number of threads in a thread team.

ordered (OpenMP Clauses)

Required on a parallel for (OpenMP) statement if an ordered (OpenMP Directives) directive is to be used in the loop.

private (OpenMP)

Specifies that each thread should have its own instance of a variable.

reduction

Specifies 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.

schedule

Applies to the for (OpenMP) directive.

shared (OpenMP)

Specifies that one or more variables should be shared among all threads.

See Also

Reference

OpenMP Directives

Other Resources

OpenMP in Visual C++