Specifies an environment for the while loop in which to enqueue the units of work specified by the enclosed task pragma.
#pragma intel_omp_taskq |
[clause[[,]clause]...] |
structured-block |
where clause can be any of the following:
private (variable-list)
firstprivate (variable-list)
lastprivate (variable-list)
reduction (operator : variable-list)
ordered
nowait
private(variable-list) |
The private clause creates a private, default-constructed version for each object in variable-list for the taskq. It also implies captureprivate on each enclosed task. The original object referenced by each variable has an indeterminate value upon entry to the construct, must not be modified within the dynamic extent of the construct, and has an indeterminate value upon exit from the construct. |
firstprivate (variable-list) |
The firstprivate clause creates a private, copy-constructed version for each object in variable-list for the taskq. It also implies captureprivate on each enclosed task. The original object referenced by each variable must not be modified within the dynamic extent of the construct and has an indeterminate value upon exit from the construct. |
lastprivate (variable-list) |
The lastprivate clause creates a private, default-constructed version for each object in variable-list for the taskq. It also implies captureprivate on each enclosed task. The original object referenced by each variable has an indeterminate value upon entry to the construct, must not be modified within the dynamic extent of the construct, and is copy-assigned the value of the object from the last enclosed task after that task completes execution. |
reduction(operator : variable-list) |
The reduction clause performs a reduction operation with the given operator in enclosed task constructs for each object in variable-list. operator and variable-list are defined the same as in the OpenMP Specifications. |
ordered |
The ordered clause performs ordered constructs in enclosed task constructs in original sequential execution order. The taskq directive, to which the ordered is bound, must have an ordered clause present. |
nowait |
The nowait clause removes the implied barrier at the end of the taskq. Threads may exit the taskq construct before completing all the task constructs queued within it. |
The intel_omp_taskq/taskq pragma specifies the environment within which the enclosed units of work (tasks) are to be executed. From among all the threads that encounter a taskq pragma, one is chosen to execute it initially.
Conceptually, the taskq pragma causes an empty queue to be created by the chosen thread, and then the code inside the taskq block is executed single-threaded. All the other threads wait for work to be enqueued on the conceptual queue.
The task pragma specifies a unit of work, potentially executed by a different thread. When a task pragma is encountered lexically within a taskq block, the code inside the task block is conceptually enqueued on the queue associated with the taskq. The conceptual queue is disbanded when all work enqueued on it finishes, and when the end of the taskq block is reached.
For an example on how to use taskq pragma see topic Workqueuing Example Function in Optimizing Applications>Using Parallelism: OpenMP* Support>Intel(R) Workqueing Model.