Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public
Document Table of Contents

DISPATCH

OpenMP* Fortran Compiler Directive: Determines whether a variant of a procedure is called for a given function or subroutine call. This feature is only available for ifx.

Syntax

!$OMP DISPATCH [clause[[,] clause]... ]

   statement

[!$OMP END DISPATCH]

clause

Is one or more of the following:

  • DEPEND ([depend-modifier, ] dependence-type : locator-list)

    Adds the DEPEND properties to the interoperability set.

  • DEVICE (scalar-integer-expression)

    Causes the value of the default-device-var ICV of the generated task to be set to the value of the DEVICE clause expression.

  • INTEROP (list)

    Specifies interop-variables to be substituted for the appended interop arguments constructed by the APPEND_ARGS clause in the corresponding DECLARE VARIANT declaration when variant dispatch occurs.

    The list items are integer scalar variables with kind type OMP_INTEROP_TYPE.

    If there are n variables in the list, the first n modifiers in the APPEND_ARGS clause of the associated DECLARE VARIANT directive are skipped, and the n variables are passed as the first n appended arguments, in the order that they appear in list.

    If the INTEROP clause appears in the DISPATCH directive, the corresponding DECLARE VARIANT directive must have an APPEND_ARGS clause with at least as many interop-types listed as there are list items in the INTEROP clause in the DISPATCH directive.

    If the INTEROP directive appears with only one list item and the DEVICE clause does not appear, it is as if DEVICE was specified with the device number property of the listed interop-var.

    The DEVICE clause is required if there is more than one list item specified in the INTEROP clause.

  • IS_DEVICE_PTR (list)

    Identifies its list items as device pointers. The IS_DEVICE_PTR property for each list item is added to the interoperability requirement set.

    Each IS_DEVICE_PTR list item must be of type C_PTR from the intrinsic module ISO_C_BINDING

  • NOCONTEXT (scalar-logical-expression)

    If a NOCONTEXT clause appears and the scalar-logical-expression evaluates to .TRUE., the DISPATCH construct is not added to the construct set of the OpenMP context.

    If the NOCONTEXT expression evaluates to .FALSE., the DISPATCH directive is added to the OpenMP* context.

  • NOVARIANTS (scalar-logical-expression)

    If a NOVARIANTS clause appears, and the scalar-logical-expression evaluates to .TRUE., no function variant is selected for execution as the target-call, even if one would otherwise have been selected.

    If the NOVARIANTS expression evaluates to .FALSE., and a variant exists that specified an OpenMP* context in the MATCH clause that matches the current context, the variant is called

  • NOWAIT

    Adds the NOWAIT property to the interoperability requirement set.

Variables used in the expression of a NOVARIANTS clause or a NOCONTEXT clause are implicitly referenced in all enclosing contexts of the DISPATCH directive.

Only one of each of the following clauses is permitted in a DISPATCH directive: NOWAIT, NOCONTEXT, and NOVARIANT.

statement

Is a Fortran statement with one of these forms:

  • var = target_proc ( [argument-list] )

  • CALL target_proc [ ( [argument-list] ) ]

target_proc must be a procedure name; it cannot be a procedure pointer.

The DISPATCH directive creates an explicit task around the associated code as if a TASK construct was present. Properties added to the interoperability requirement set can be removed by other directives. The task will be an included task if the interoperability requirement set does not contain a NOWAIT property.

If the interoperability requirements set contains DEPEND properties, it is as if the TASK construct contained the corresponding DEPEND clauses.