Intel® Fortran Compiler 16.0 User and Reference Guide
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:
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:
The new device data environment uses the corresponding list item from the enclosing device data environment.
No additional storage is allocated in the new device data environment.
Initialization and assignment are not performed, regardless of the map-type that is specified.
When a corresponding list item is not in the data environment of the device associated with the construct:
A new list item is derived from the original list item; it becomes the corresponding list item in the new device data environment.
Storage with automatic duration is allocated for the new list item. It has the same type, type parameter, and rank as the original list item. The storage and lifetime of the new list item lasts until the block in which it is created exits. The size and alignment of the new list item are determined by the type of the variable.
Initialization and assignment are performed if specified by the map-type.
Any variables within a TARGET MAP region that are not specified in a MAP clause are treated as shared variables within the region.