Next: MIMD Example
Up: Data Parallel Execution
Previous: Pure Function Example
PURE SUBROUTINE G(x,y,z)
IMPLICIT NONE
REAL, INTENT(OUT), DIMENSION(:) :: z
REAL, INTENT(IN), DIMENSION(:) :: x, y
INTEGER i
INTERFACE
REAL FUNCTION F(x,y)
REAL, INTENT(IN) :: x, y
END FUNCTION F
END INTERFACE
! ...
FORALL(i=1:SIZE(z)) z(i) = F(x(i),y(i))
END SUBROUTINE G
Note:
- invokes pure procedure,
- interface not mandatory but is a very good idea.
Example of use,
CALL G(x,y,res)
For more information, click here
Now try this question
Next: MIMD Example
Up: Data Parallel Execution
Previous: Pure Function Example
Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 18:56:08 GMT 1996Not for commercial use.