Intel® Fortran Compiler 17.0 Developer Guide and Reference

TARGET Directive

OpenMP* Fortran Compiler Directive: Creates a device data environment and executes the construct on that device. This directive only applies to Intel® MIC Architecture.

!$OMP TARGET [clause[[,] clause]... ]

   block

!$OMP END TARGET

clause

Is one or more of the following:

  • DEFAULTMAP (TOFROM:SCALAR)

    Causes a scalar variable to be treated as if it appeared in a MAP clause with a map-type of TOFROM.

    If this clause is not specified, a scalar variable is not mapped; instead it has an implicit attribute of FIRSTPRIVATE. At most one DEFAULTMAP clause can appear in the directive.

  • DEPEND (dependence-type : list)
  • DEVICE (integer-expression)
  • IF ([TARGET:] scalar-logical-expression)
  • IS_DEVICE_PTR (list)

    Indicates that a list item is a device pointer currently in the device data environment and that it should be used directly.

    The list is one or more dummy arguments.

    If a list item in a MAP clause is an array section, and the array section is derived from a variable with a POINTER or ALLOCATABLE attribute, then the behavior is unspecified if the corresponding list item’s variable is modified in the region.

  • MAP ([[map-type-modifier[,]] map-type: ] list)
  • NOWAIT

block

Is a structured block (section) of statements or constructs. No branching into or out of the block of code is allowed.

The binding task for a TARGET construct is the encountering task. The target region binds to the enclosing parallel or task region.

This construct provides a superset of the functionality provided by the TARGET DATA construct, except for the clause USE_DEVICE_PTR.

The TARGET construct also specifies that the region is executed by a device. The encountering task waits for the device to complete the target region at the end of the construct.

If a TARGET, TARGET DATA, or TARGET UPDATE construct appears within a target region, the construct is ignored.

See Also