Loop-level parallelism: Difference between revisions

Content deleted Content added
Ewhorton (talk | contribs)
Ewhorton (talk | contribs)
Line 98:
In loop-independent dependence, loops have inter-iteration dependence, but do not have dependence between iterations. Each iteration may be treated as a block and performed in parallel without other synchronization efforts.
 
In the following example code used for swapping the values of two array of length n, there is a loop-independent dependence of <code>S1[i] ->T S3[i]</code>.
<syntaxhighlight>
for (int i = 1; i < n; i ++) {
Line 106:
}
</syntaxhighlight>
In loop-carried dependence, statements in an iteration of a loop depend on statements in another iteration of the loop. Loop-Carried Dependence uses a modified version of the dependence notation seen earlier. The following denotes a statement carries a true dependence to a later iteration, meaning that one iteration of the loop writes to a ___location read by a subsequent iteration of the loop.
 
Example of loop-carried dependence where <code>S1[i] ->T S1[i + 1]</code>, where <code>i</code> indicates the current iteration, and <code>i + 1</code> indicates the next iteration.
 
<source>