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

13.2  device Clause

Name: device

Properties: unique

Arguments

Name

Type

Properties

device-description

expression of integer type

default

Modifiers

Name

Modifies

Type

Properties

device-modifier

device-description

Keyword: ancestor, device_num

default

Directives

dispatch, interop, target, target data, target enter data, target exit data, target update

Semantics

The device clause identifies the target device that is associated with a device construct.

If device_num is specified as the device-modifier, the device-description specifies the device number of the target device. If device-modifier does not appear in the clause, the behavior of the clause is as if device-modifier is device_num. If the device-description evaluates to omp_invalid_device, runtime error termination is performed.

If ancestor is specified as the device-modifier, the device-description specifies the number of target nesting level of the target device. Specifically, if the device-description evaluates to 1, the target device is the parent device of the enclosing target region. If the construct on which the device clause appears is not encountered in a target region, the current device is treated as the parent device.

Unless otherwise specified, for directives that accept the device clause, if no device clause is present, the behavior is as if the device clause appears without a device-modifier and with a device-description that evaluates to the value of the default-device-var ICV.

Restrictions

Cross References