Technical data
#pragma Directives [3]
The prefervector directive tells the compiler to vectorize the loop that
immediately follows the directive if the loop contains more than one loop in the
nest that can be vectorized. The directive states a vectorization preference and
does not guarantee that the loop has no memory dependence hazard.
The format of this directive is as follows:
#pragma _CRI prefervector
The following example illustrates the use of the prefervector directive:
#pragma _CRI prefervector
for (i = 0; i < n; i++) {
#pragma _CRI ivdep
for (j = 0; j < m; j++)
a[i] += b[j][i];
}
In the preceding example, both loops can be vectorized, but the directive directs
the compiler to vectorize the outer for loop. Without the directive and without
any knowledge of n and m, the compiler vectorizes the inner for loop. In this
example, the outer for loop is vectorized even though the inner for loop had an
ivdep directive. See also the prefertask directive in Section 3.8.12, page 78.
3.7.6 shortloop and shortloop128 Directives
Scope: Local
The shortloop (all systems) and shortloop128 (UNICOS systems only)
directives improve performance of a vectorized loop by allowing the compiler
to omit the run-time test to determine whether it has been completed. The
shortloop compiler directive identifies vector loops that execute with a
maximum iteration count of 64 (504 for character arrays) and a minimum
iteration count of 1. The shortloop128 compiler directive identifies vector
loops that execute with a maximum iteration count of 128 (1016 for character
arrays) and a minimum iteration count of 1. If the iteration count is outside the
range for the directive, results are unpredictable.
These directives are ignored if the loop trip count is known at compile time and is
greater than the target machine’s vector length. The vector length of UNICOS
systems is 64.
S–2179–36 61










