Developer Guide and Reference

Contents

parallel/noparallel

Resolves dependencies to facilitate auto-parallelization of the immediately following loop (parallel) or prevents auto-parallelization of the immediately following loop (noparallel).

Syntax

#pragma parallel
[
clause
[ [
,
]
clause
]
...
]
#pragma noparallel
Arguments
clause
Can be any of the following:
always [assert]
Overrides compiler heuristics that estimate whether parallelizing a loop would increase performance. Using this clause on a loop that the compiler finds to be parallelizable tells the compiler to parallelize the loop even if doing so might not improve performance.
If
assert
is added, the compiler will generate an error-level assertion test to display a message saying that the compiler efficiency heuristics indicate that the loop cannot be vectorized.
firstprivate
(
var
[ :
expr
] ... )text
Provides a superset of the functionality provided by the
private
clause. Variables that appear in a
firstprivate
list are subject to
private
clause semantics. In addition, its initial value is broadcast to all private instances upon entering the parallel loop.
lastprivate
(
var
[ :
expr
] ... )
Provides a superset of the functionality provided by the
private
clause. Variables that appear in a
lastprivate
list are subject to private clause semantics. In addition, when the parallel region is exited, each variable has the value that results from the sequentially last iteration of the loop up exiting the parallel loop.
num_threads
(
n
)
Parallelizes the loop across
n
threads, where
n
is an integer.
private
(
var
[ :
expr
] ...)