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.

firstprivate(var)

Parameters

Parameter

Description

var

The variable to have instances in each thread and that will be initialized with the value of the variable, because it exists before the parallel construct. If more than one variable is specified, separate variable names with a comma.

Remarks

firstprivate applies to the following directives:

For more information, see 2.7.2.2 firstprivate.

Example

For an example of using firstprivate, see the example in private (OpenMP).

See Also

Reference

OpenMP Clauses