Next: Consequences of the
Up: The FORALL Statement
Previous: Examples of the
One way to understand the semantics of the FORALL statement is to
exhibit a naive translation to scalar Fortran 90 code. We provide such
a translation below.
- []Advice
to implementors.
Note, however, that such a translation is meant for illustration rather
than as the definitive reference to the FORALL semantics of or
practical implementation in the compiler. In particular, implementing
a FORALL using DO loops imposes an apparent order on the
operations that is not implied by the formal definition. Additionally,
compiler analysis of particular cases may allow significant
simplification and optimization. For example, if the array assigned in
a FORALL statement is not referenced in any other expression in
the FORALL (including its use in functions called from the FORALL), it is legal and, on many machines, more efficient to perform
the computations and final assignments in a single loop nest. Also
note the discussion at the end of this section regarding other
difficulties of a Fortran 90 translation.
(End of advice to implementors.)
A forall-stmt of the form
_=13_}
paula@erc.msstate.edu
Thu Dec 8 16:17:11 CST 1994