HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

5.5.10  in_reduction Clause

Name: in_reduction

Properties: data-environment attribute, data-sharing attribute, privatization, reduction participating

Arguments

Name

Type

Properties

list

list of variable list item type

default

Modifiers

Name

Modifies

Type

Properties

reduction-identifier

list

An OpenMP reduction identifier

required, ultimate

Directives

target, task, taskloop

Semantics

The in_reduction clause is a reduction participating clause, as described in Section 5.5.7, that specifies that a task participates in a reduction. For a given list item, the in_reduction clause defines a task to be a participant in a task reduction that is defined by an enclosing region for a matching list item that appears in a task_reduction clause or a reduction clause with task as the reduction-modifier, where either:

1.
The matching list item has the same storage location as the list item in the in_reduction clause; or
2.
A private copy, derived from the matching list item, that is used to perform the task reduction has the same storage location as the list item in the in_reduction clause.

For the task construct, the generated task becomes the participating task. For each list item, a private copy may be created as if the private clause had been used.

For the target construct, the target task becomes the participating task. For each list item, a private copy may be created in the data environment of the target task as if the private clause had been used. This private copy will be implicitly mapped into the device data environment of the target device, if the target device is not the parent device.

At the end of the task region, if a private copy was created its value is combined with a copy created by a reduction scoping clause or with the original list item.

Restrictions

Restrictions to the in_reduction clause are as follows:

Cross References