Intel® Fortran Compiler 16.0 User and Reference Guide

MAP Clause

Clause for TARGET Directives: Maps a variable from the data environment of the current task to the data environment of the device associated with the construct. For each original list item in this clause, a new corresponding list item is created on the device. This clause only applies to the TARGET directives, which are only available on Intel® MIC Architecture.

MAP ([map-type :] list)

map-type

Determines how a list item is initialized. Possible values are:

ALLOC

On entry to the device region, each new corresponding list item has an undefined initial value.

FROM

On exit from the device region, the value of the corresponding list item is assigned to each original list item.

TO

On entry to the device region, each new corresponding list item is initialized with the value of the original list item.

TOFROM

On entry to the device region, each new corresponding list item is initialized with the value of the original list item. On exit from the device region, the value of the corresponding list item is assigned to each original list item.

If a map-type is not specified, the default is TOFROM.

The map initialization and assignment are done as if by intrinsic assignment, that is, through bitwise copy.

list

Is the name of one or more variables, array sections, or common blocks that are accessible to the scoping unit. Subobjects cannot be specified. Each name must be separated by a comma, and a common block name must appear between slashes (/ /).

If a list item is an array section, it must specify contiguous storage.

A list item can appear in at most one of the TO, FROM, or TOFROM clauses. If a list item appears in an ALLOC clause, it cannot appear on a TO or TOFROM clause.

At least one MAP clause must appear in a directive that allows the clause.

THREADPRIVATE variables cannot appear in a MAP clause.

For the TARGET ENTER DATA directive, map-type must be either TO or ALLOC.

For the TARGET EXIT DATA directive, map-type must be FROM.

If original and corresponding list items share storage, data races can result when intervening synchronization between tasks does not occur. If variables that share storage are mapped, it causes unspecified behavior.

When a corresponding list item of the original list item is in the data environment of the device associated with the construct:

When a corresponding list item is not in the data environment of the device associated with the construct:

Any variables within a TARGET MAP region that are not specified in a MAP clause are treated as shared variables within the region.