Intel® Fortran Compiler XE 13.1 User and Reference Guides
OFFLOAD Compiler Directive: Initiates asynchronous data transfer, or initiates and completes synchronous data transfer. This directive only applies to Intel® MIC Architecture.
!DIR$ OFFLOAD_TRANSFER specifier[[,] specifier...]
specifier |
Can be any of the following:
|
The following arguments are used in the above specifier items:
target-name |
Is an identifier that represents the target. The only allowable target name is MIC. |
|||||||||||||||
target-number |
(Required for SIGNAL and WAIT) Is an integer expression whose value is interpreted as follows:
If you don't specify this argument, the runtime system chooses whether to execute the code on the CPU or the coprocessor, and if multiple coprocessors are available, on which coprocessor. For example, in a system with 4 coprocessors:
|
|||||||||||||||
if-specifier |
Is a Boolean expression. If the expression evaluates to true, then the data transfer specified by the directive occurs. If the specified target coprocessor is absent from the system or not available at that time because it is fully loaded, then no action is taken. If the expression evaluates to false, then no action is taken and none of the other offload clauses have any effect. |
|||||||||||||||
tag |
Is a scalar integer variable. It cannot have the ALLOCATABLE or the POINTER attribute. When used with SIGNAL, tag is a memory reference and is associated with the data set in an asynchronous computation. tag can be used in subsequent WAIT clauses in other OFFLOAD directives. When used with WAIT, tag is a memory reference; it is associated with a previously initiated asynchronous computation or asynchronous data transfer. Use the same tag that you specified in the SIGNAL specifier to start the asynchronous computation or data transfer with the OFFLOAD or OFFLOAD_TRANSFER directive. |
|||||||||||||||
offload-parameter |
Can be any of the following data movement clauses:
When a program runs in a heterogeneous environment, program variables are copied back and forth between the CPU and the target. The offload-parameter is a specification for controlling the direction in which variables are copied, and for pointers, the amount of data that is copied.
This specifier is required. It must not contain both an IN clause and an OUT clause. An IN or OUT element-count-expr expression (see description below within modifier) is evaluated at a point in the program before the statement or clause in which it is used. An array variable whose size is known from its declaration is copied in its entirety. If a subset of an array is to be processed, use the name of the starting element of the subset and the element-count-expr to transfer the array subset. |
|||||||||||||||
identifier |
Is a variable, a subscripted variable, an array slice, or a component reference. |
|||||||||||||||
modifier |
Is one of the following:
|
You can choose whether to offload a statement based on runtime conditions, such as the size of a data set. The IF (if-specifier) clause lets you specify the condition.
Use SIGNAL (tag) to start the asynchronous computation.
The SIGNAL and WAIT clauses refer to a specific target device, so you must specify target-number in the TARGET clause. If you query a signal before the signal has been initiated, it results in undefined behavior and a runtime abort of the application. For example, if you query a signal (SIG1) on target device 0 that was initiated for target device 1, it results in a runtime abort of the application. This is because the signal (SIG1) was initiated for target device 1, so there is no signal (SIG1) associated with target device 0.
If the if-specifier evaluates to false and a SIGNAL (tag) clause is used in the directive, then the SIGNAL is undefined and any WAIT on this SIGNAL has undefined behavior.
See the example in OFFLOAD.