Visible to Intel only — GUID: GUID-44A27D87-BFDF-4BEB-AD25-27E460025C0B
Visible to Intel only — GUID: GUID-44A27D87-BFDF-4BEB-AD25-27E460025C0B
DECLARE TARGET
OpenMP* Fortran Compiler Directive: Specifies that named variables, common blocks, functions, and subroutines are mapped to a device. This feature is only available for ifx.
!$OMP DECLARE TARGET [(extended-list)]
-or-
!$OMP DECLARE TARGET[clause]
extended-list |
Is a list of one or more variables, functions, subroutines, data pointers, procedure pointers, or common blocks. If you specify more than one extended-list item, they must be separated by commas. A common block name must appear between slashes (/ /); you cannot specify a blank common block. The specified extended-list items can be used inside a target region that executes on the device. If the extended-list item is a function or subroutine, it must not be a generic name or entry name. A device-specific version of the routine is created that can be called from a target region. If the extended-list item is a variable:
You cannot specify the following variables in the DECLARE TARGET directive:
If the extended-list item is a common block:
|
clause |
Is the following:
|
If you specify list, this directive can only appear in a specification part of a subroutine, function, program, or module.
If you do not specify list, the directive must appear in the specification part of the relevant subroutine, function, or interface block.
If a DECLARE TARGET directive is specified in an interface block for a procedure, it must match a DECLARE TARGET directive in the definition of the procedure.
If a procedure is declared in a procedure declaration statement, any DECLARE TARGET directive containing the procedure name must appear in the same specification part.
The following additional rules apply to variables and common blocks:
The DECLARE TARGET directive must appear in the declaration section of a scoping unit in which the common block or variable is declared.
If a variable or common block is declared with the BIND attribute, the corresponding C entities must also be specified in a DECLARE TARGET directive in the C program.
Variables with static storage and procedures used in an OMP TARGET region are implicitly treated as OMP DECLARE TARGET:
MODULE VARS
INTEGER X
END MODULE
REAL FUNCTION FOO()
END FUNCTION
!$OMP TARGET
X = FOO() ! X and FOO are implicitly DECLARE TARGET
!$OMP END TARGET