LOOP COUNT

General Compiler Directive: Specifies the iterations (count) for a DO loop.

Syntax

cDEC$ LOOP COUNT (n1 [, n2] ...)

cDEC$ LOOP COUNT = n1 [, n2] ...

cDEC$ LOOP COUNT MAX(n1), MIN(n1), AVG(n1)

cDEC$ LOOP COUNT MAX=n1, MIN=n1, AVG=n1

c
Is one of the following: C (or c), !, or *. (See Syntax Rules for Compiler Directives.)


n1, n2
Is a non-negative integer constant.


Description

The value of the loop count affects heuristics used in software pipelining, vectorization, and loop-transformations.

Argument Form  Description
n1 [, n2] Indicates that the next DO loop will iterate n1, n2, or some other number of times.
MAX, MIN, and AVG Indicates that the next DO loop has the specified maximum, minimum, and average number (n1) of iterations.

See Also

Rules for General Directives that Affect DO Loops, Optimizing Applications: Loop Count and Loop Distribution

Example

Consider the following:

cDEC$ LOOP COUNT (10000)
do i =1,m
b(i) = a(i) +1 ! This is likely to enable the loop to get software-pipelined
enddo

Note that you can specify more than one LOOP COUNT directive for a DO loop. For example, the following directives are valid:

!DEC$ LOOP COUNT (10, 20, 30)
!DEC$ LOOP COUNT MAX=100, MIN=3, AVG=17
DO
...