next up previous contents
Next: Forall Examples Up: Data Parallel Execution Previous: Data Parallel Execution

 

Forall Statement

FORALL statement is in Fortran 95, syntax:

 
FORALL(< forall-triplet-list >[,< scalar-mask >])&

< assignment-stmt >

For example,

  
    FORALL (i=1:n,j=1:m,A(i,j).NE.0) &
           A(i,j) = 1/A(i,j)

The stated assignment is performed in parallel for all specified values of i and j for which the mask expression is .TRUE..

For more information, click here gif

Now try this question gif


next up previous contents
Next: Forall Examples Up: Data Parallel Execution Previous: Data Parallel Execution

©University of Liverpool, 1997
Wed May 28 23:37:18 BST 1997
Not for commercial use.