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)
Remarks
where,
- 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
See sections (OpenMP) for an example of using firstprivate.