Intel® Fortran Compiler 17.0 Developer Guide and Reference

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. This clause only applies to the TARGET directives, which are only available on Intel® MIC Architecture.

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

map-type-modifier

Is the following:

ALWAYS

Specifies that initialization should always occur for the list items.

map-type

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

ALLOC

On entry to the outermost 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.

This is ignored for nested regions unless map-type-modifierALWAYS is specified.

TO

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

This is ignored for nested regions unless map-type-modifierALWAYS is specified.

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.

This is ignored for nested regions unless map-type-modifierALWAYS is specified.

DELETE

On exit from the device region, if the corresponding list item is present on the device, it is then deleted from the device.

RELEASE

On exit from the outermost device region, the corresponding list item is deleted from the device.

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.

On entry to an outermost target region where this clause is used, for each original list item, a new corresponding list item is created on the device. On exit from the outermost target region, if the corresponding list item is present on the device, it is then deleted from the device.

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, RELEASE, or DELETE.

For the TARGET and TARGET DATA directives, map-type must be TO, FROM, TOFROM, or ALLOC.

For the TARGET UPDATE directive, map-type must be TO or 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.

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

A list item must not contain any components that have the ALLOCATABLE attribute.

If the allocation status of a list item with the ALLOCATABLE attribute is unallocated upon entry to a target region, the list item must be unallocated upon exit from the region.

If the allocation status of a list item with the ALLOCATABLE attribute is allocated upon entry to a target region, the allocation status of the corresponding list item must not be changed and must not be reshaped in the region.

If an array section of an allocatable array is mapped and the size of the section is smaller than that of the whole array, the target region must not have any reference to the whole array.

See Also