Cypress CSC-1200T Betriebsanweisung Seite 57

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 124
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 56
Chapter 6. C and C++ programming 57
In the previous format, var_list represents a list of variable names sepa-
rated by commas. In C, the cache_align directive can appear before or
after the declaration of the named objects. In C++, it must appear after
the declaration of all named objects.
noreduction
The noreduction compiler directive tells the compiler not to optimize
the loop that immediately follows the directive as a reduction loop. If
the loop is not a reduction loop, the directive is ignored.
You may choose to use this directive when the loop iteration count is
small or when the order of evaluation is numerically significant. In the
latter case normal optimization may change the result of a reduction
loop, because it rearranges the operations.
The format of this directive is:
#pragma _CRI noreduction
The following example illustrates the use of the noreduction compiler
directive:
sum=0;
#pragma _CRI noreduction
for (i=0; i<n; i++) {
sum += a[i];
}
Here we know that n will be a small number and therefore we do not
want to optimize this loop as a reduction loop.
split
The split directive instructs the compiler to attempt to split the follow-
ing loop into a set of smaller loops. Such a loop splitting improves single
processor performance by making the best use of the six stream buffers
of the Cray T3E system. The stream buffers reduce memory latency
and increase memory bandwidth by prefetching for long, small-strided
sequences of memory references.
The split directive may avoid performance problems with the stream
buffers by splitting an inner loop into a set of smaller loops, each of
which allocates no more than six stream buffers.
The split directive has the following form:
#pragma _CRI split
This compiler directive should be placed immediately before the loop
to be split. It should immediately precede a for, while, do or label
statement, but it should not appear in any other context.
Seitenansicht 56
1 2 ... 52 53 54 55 56 57 58 59 60 61 62 ... 123 124

Kommentare zu diesen Handbüchern

Keine Kommentare