Chapter 7. Using an Accelerator
#pragma acc directive-name [clause [,clause]…] new-line
Rules
In addition to the general directive rules, the following rules apply to PGI Accelerator compiler C directives:
• Each directive starts with
#pragma acc
.
• The remainder of the directive follows the C conventions for pragmas.
• White space may be used before and after the #; white space may be required to separate words in a directive.
• Preprocessing tokens following the
#pragma acc are subject to macro replacement.
• C directives are case sensitive.
• An Accelerator directive applies to the immediately following structured block or loop.
Free-Form Fortran Directives
PGI Accelerator compiler Fortran directives can be either Free-Form or Fixed-Form directives. Free-Form
Accelerator directives are specified with the
!$acc
mechanism.
Syntax
The syntax of directives in free-form source files is:
!$acc directive-name [clause [,clause]…]
Rules
In addition to the general directive rules, the following rules apply to PGI Accelerator compiler Free-Form
Fortran directives:
• The comment prefix (!) may appear in any column, but may only be preceded by white space (spaces and tabs).
• The sentinel (!$acc) must appear as a single word, with no intervening white space.
• Line length, white space, and continuation rules apply to the directive line.
• Initial directive lines must have a space after the sentinel.
• Continued directive lines must have an ampersand (&) as the last nonblank character on the line, prior to any comment placed in the directive.
• Comments may appear on the same line as the directive, starting with an exclamation point and extending to the end of the line.
• If the first nonblank character after the sentinel is an exclamation point, the line is ignored.
• Directives are case-insensitive.
• Directives cannot be embedded within continued statements.
89