[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
Execution of an element array assignment consists of the following steps:
If the scalar mask expression is omitted, it is as if it were present with the value .TRUE.
A forall-stmt is not HPF-conforming if the result of evaluating any expression in the forall-header affects or is affected by the evaluation of any other expression in the forall-header.
A forall-stmt is not HPF-conforming if it causes any atomic data object to be assigned more than one value. A data object is atomic if it contains no subobjects. For the purposes of this restriction, any assignment (including array assignment or assignment to a variable of derived type) to a non-atomic object is considered to assign to all subobjects contained by that object.
FORALL ( i = 1:10 ) a(indx(i)) = b(i) if and only if indx contains no repeated values. Note that it restricts FORALL behavior, but not syntax. Syntactic restrictions to enforce this behavior would be either incomplete (ie. allow undefined behavior) or exclude conceptually legal programs.
Since a function called from a forall-assignment must be pure, it is impossible for that function's evaluation to affect other expressions' evaluations, either for the same combination of index-name values or for a different combination. In addition, it is possible that the compiler can perform more extensive optimizations because all functions are pure. (End of rationale.)
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |