Visible to Intel only — GUID: GUID-10FE7372-F63C-437C-87B5-66CD1A261B1A
Visible to Intel only — GUID: GUID-10FE7372-F63C-437C-87B5-66CD1A261B1A
INTEROP
OpenMP* Fortran Compiler Directive: Identifies a foreign runtime context and identifies runtime characteristics of that context, enabling interoperability with it. This feature is only available for ifx.
Syntax
!$OMP INTEROP clause[[[,] clause]... ]
clause |
Is one or more of the following:
|
action-clause |
Is one of the following:
You must specify at least one action-clause. Each interop-type can appear at most once in an action-clause. For the USE and DESTROY action-clauses, the interop-type is whatever interop-type was used when initializing the interop-var. |
modifier-list |
Is interop-type [[, interop-type] . . . ] |
interop-type |
Is one of the following:
TARGET and TARGETSYNC may appear at most once in the clause. At least one modifier must be specified. |
preference-list |
Is a list of one or more foreign-runtime-ids, which can be character constants or integer constant expressions with kind type omp_interop_fr_kind. If you specify more than one foreign-runtime-id, they must be separated by commas. The character values recognized by ifx are "opencl", "sycl", and "level_zero", which have corresponding integer values of 3, 4, and 6, respectively. You can specify integer constants OMP_IFR_OPENCL, OMP_IFR_SYCL, and OMP_IFR_LEVEL_ZERO in the preference-list. Definitions for these integer constants are in module omp_lib. Other character, integer, or named constants are accepted and silently ignored. The list of foreign-runtime-ids is scanned in left-to-right lexical order. The left-most supported foreign-runtime-id in preference-list is used. If the implementation does not support any of the listed foreign-runtime-ids in preference-list, the behavior is unspecified. |
interop-var |
Is a scalar integer variable with kind type omp_interop_kind. The interop-var of an INIT or DESTROY action-clause must not be a constant. The same interop-var cannot be specified in more than one action-clause of the INTEROP construct. |
A task that encounters an INTEROP construct executes the region.
If a DEVICE clause is not specified, the behavior is as if a DEVICE clause is present with the integer value equal to the value of the internal control variable (ICV) default-device-var specified.
OpenMP* may interoperate with one or more foreign runtime environments using the INTEROP directive, the INTEROP clause on a DECLARE VARIANT directive, or the interoperability functions in the OpenMP* runtime API.
A task has an interoperability requirement set, which is a logical set of properties. Properties can be added to or removed from the set by different directives. The properties can be queried by other constructs that have interoperability semantics. The following properties can be added by a construct:
DEPEND - requires the construct enforce the synchronization relationship specified by the DEPEND clause
IS_DEVICE_PTR (list-item) - indicates that the list-item is a device pointer within the construct
NOWAIT - indicates that the construct is asynchronous
The DISPATCH directive can add properties to the interoperability requirement set.
The DECLARE VARIANT directive can remove properties from the interoperability requirement set.
If the interop-var is initialized with TARGETSYNC, an empty mergeable task is generated. DEPEND clauses apply to the generated task. If NOWAIT is omitted, the generated task is also an included task. The INTEROP construct guarantees ordered execution of the generated task with respect to foreign tasks executing in foreign contexts through the foreign synchronization object accessible through the TARGETSYNC property of the interop-var.
If a foreign task is created prior to encountering an INTEROP construct, the foreign task must complete execution before the generated task executes. If the creation of a foreign task occurs after an INTEROP construct is encountered, the foreign task cannot begin execution until the generated task finishes execution. The INTEROP construct imposes no ordering between the thread that encounters it and foreign tasks or OpenMP* tasks.