A.7 Data Dependence Examples

The following loop can easily be parallelized, since there are no loopcarried dependencies:

DO 10 I = 1,N
A(I) = B(I) + 2
C(I) = A(I) + D(I)
10  CONTINUE

The next loop cannot be parallelized directly. An antidependence on A exists from the second assignment statement to the first. Addition of synchronization is needed to parallelize the loop, but that may slow execution.

DO 10 I = 1,N
A(I) = B(I) + 2
C(I) = A(I+1) + D(I)
10  CONTINUE


Previous Page|Next Page|Contents|Index|
Command-Line Switches

Copyright © Digital Equipment Corporation. 1997. All Rights Reserved.