Reduction Kind
Reduction in HPF
- Reduction variables may appear only in "reduction statements.” (i.e. S=S+X)
Reduction in HPF/JA
- Reduction variables may appear in any statements as long as the user knows " It's reduction."
- Users specify reduction kind in the REDUCTION clause.
- FISTLOC/LASTLOC for MAX/MIN is supported.
!HPF$ INDEPENDENT, REDUCTION:SUM(S), &
!HPF$ REDUCTION:MAXVAL(QMAX:FIRSTLOC(ILOC))
DO I=…
CALL SUB(SUM)
IF(QMAX.LT.Q(I)) THEN
QMAX = Q(I)
ILOC = I
ENDIF
ENDDO
SUBROUTINE SUB(SUM)
...
SUB = SUB + X
...
END