[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
A forall-construct of the form:
FORALL ( v=l:u:s, mask ) a(l:u:s) = rhs1 ELSEFORALL a(l:u:s) = rhs2 END FORALL is equivalent to the following standard Fortran 90 code:
!evaluate subscript and stride expressions in any order
templ = l tempu = u temps = s
!then evaluate the masks
DO v1=templ,tempu,temps tempmask(v) = mask(v) END DO
!then evaluate the first block of statements
DO v=templ,tempu,temps IF (tempmask(v)) THEN temprhs1(v) = rhs1 END IF END DO DO v1=templ,tempu,temps IF (tempmask(v)) THEN a(v)=temprhs1(v) END IF END DO
!then evaluate the second block of statements
DO v=templ,tempu,temps IF (not.tempmask(v)) THEN temprhs2(v) = rhs2 END IF END DO DO v1=templ,tempu,temps IF (.not.tempmask(v)) THEN a(v)=temprhs2(v) END IF END DO
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |