Intel® Fortran Compiler 16.0 User and Reference Guide
OFFLOAD Compiler Directive: Specifies a wait for a previously initiated asynchronous activity. This directive only applies to Intel® MIC Architecture.
!DIR$ OFFLOAD_WAIT clause[[,] clause...]
clause |
Can be any of the following:
|
The following arguments are used in the above clause items:
target-name |
Is an identifier that represents the target. The only allowable target name is MIC. |
||||
target-number |
Is a required integer expression whose value is interpreted as follows:
For example, in a system with 4 coprocessors:
|
||||
if-specifier |
Is a Boolean expression. If the expression evaluates to true, then execution waits for the completion of a previously initiated asynchronous data transfer or asynchronous computation. 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 expression. Its value is used to coordinate an asynchronous computation or an asynchronous data transfer. When used with WAIT, tag is an integer value associated with a previously initiated asynchronous computation or asynchronous data transfer. Use the same tag that you specified in the SIGNAL clause that started the asynchronous computation or data transfer with the OFFLOAD or OFFLOAD_TRANSFER directive. |
The OFFLOAD_WAIT directive specifies a wait for the completion of a previously initiated asynchronous data transfer performed by the OFFLOAD_TRANSFER directive, or an asynchronous computation and return data transfer, if any, performed by the OFFLOAD directive.
The WAIT clause refers to a specific target device, so you must specify target-number in the TARGET clause.
The signal associated with tag is cleared following completion of the previously initiated asynchronous data transfer or asynchronous computation. 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.
When you specify the STATUS clause, it affects the behavior of optional and mandatory offloads differently when the offload request is not successful:
For an optional offload, the computation is performed on the CPU and the status variable has an appropriate value.
For a mandatory offload, there is no CPU fallback. The program does not terminate. You must examine the value of the status variable, determine the reason the offload failed, and decide what action to take.
For both optional and mandatory offloads, when offload is successful, the status variable has the value OFFLOAD_SUCCESS.
See the examples in OFFLOAD.