Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

♦ ♦ ♦ ACP P E N D I X C

Fortran Directives Summary

This appendix summarizes the directives recognized by f95 Fortran compiler:

General Fortran Directives

Sun Parallelization Directives

Cray Parallelization Directives

OpenMP Fortran 95 Directives, Library Routines, and Environment

C.1 General Fortran Directives

General directives accepted by f95 are described in “2.3 Directives” on page 29.

TABLE 32 Summary of General Fortran Directives

Format

!$PRAGMA keyword ( a [ , a ] … ) [ , keyword ( a [ , a ] … ) ] ,… !$PRAGMA SUN keyword ( a [ , a ] … ) [ , keyword ( a [ , a ] … ) ] ,…

Comment-indicator in column 1 may be c, C, !, or *. (We use ! in these examples. f95 free-format must use !.)

C Directive

!$PRAGMA C(list)

 

Declares a list of names of external functions as C language routines.

 

 

IGNORE_TKR Directive

!$PRAGMA IGNORE_TKR {name {, name} ...}

 

The compiler ignores the type, kind, and rank of the specified dummy argument

 

names appearing in a generic procedure interface when resolving a specific call.

 

 

UNROLL Directive

!$PRAGMA SUN UNROLL=n

 

Advises the compiler that the following loop can be unrolled to a length n.

 

 

WEAK Directive

!$PRAGMA WEAK(name[=name2])

 

Declares name to be a weak symbol, or an alias for name2.

 

 

Appendix C • Fortran Directives Summary

223

C.2 Special Fortran Directives

OPT Directive

!$PRAGMA SUN OPT=n

 

Set optimization level for a subprogram to n.

 

 

PIPELOOP Directive

!$PRAGMA SUN PIPELOOP[=n]

 

Assert dependency in loop between iterations n apart.

 

 

PREFETCH Directives

!$PRAGMA SUN_PREFETCH_READ_ONCE (name)

 

!$PRAGMA SUN_PREFETCH_READ_MANY (name)

 

!$PRAGMA SUN_PREFETCH_WRITE_ONCE (name)

 

!$PRAGMA SUN_PREFETCH_WRITE_MANY (name)

 

Request compiler generate prefetch instructions for references to name. (Requires -

 

xprefetch option, which is enabled by default. Prefetch directives can be disabled

 

by compiling with —xprefetch=no. Target architecture must also support prefetch

 

instructions, and the compiler optimization level must be set greater than —xO2.)

 

 

ASSUME Directives

!$PRAGMA [BEGIN} ASSUME (expression [,probability])

 

!$PRAGMA END ASSUME

 

Make assertions about conditions at certain points in the program that the compiler

 

can assume are true.

 

 

C.2 Special Fortran Directives

The following directives are only available with f95. See “4.8.2 FIXED and FREE

Directives” on page 191 for details.

TABLE 33 Special Fortran Directives

Format

!DIR$ directive : initial line

 

!DIR$& ... : continuation line

 

With fixed-format source, C is also accepted as a directive-indicator:

 

CDIR$ directive...

 

The line must start in column 1. With free-format source, the line may be preceded by

 

blanks.

 

 

FIXED/FREE Directives

!DIR$ FREE!DIR$ FIXED

 

These directives specify the source format of the lines following the directive. They

 

apply to the rest of the source file in which they appear, up to the next FREE or FIXED

 

directive.

 

 

IVDEP

!DIR$ IVDEP

224 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

C.3 Fortran OpenMP Directives

Assert that the following DO, FORALL, or WHERE loop is free of loop-carried dependences, and can be optimized. Interpretation determined by the -xivdep option. See “2.3.3 IVDEP Directive” on page 37

C.3 Fortran OpenMP Directives

The Oracle Developer Studio Fortran compiler supports the OpenMP 3.1 Fortran API. The -openmp compiler flag enables these directives. (See “3.4.159 – xopenmp[={parallel|noopt|none}]” on page 144).

See the Oracle Developer Studio 12.6: OpenMP API User’s Guide for complete details.

Appendix C • Fortran Directives Summary

225

226 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

Соседние файлы в предмете Информационные и сетевые технологии