# ps6 - 5 Repeat the previous four steps for the following...

This preview shows page 1. Sign up to view the full content.

Problem Set 10: Dependence analysis 1. Draw the iteration space graph for the following loop: for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { A[i][j - 1] = A[i - 1][j + 2] + A[i][j + 1]; } } 2. Show the distance vector(s) for the loop from the previous problem. 3. Show the direction vector(s) for the loop. 4. Can the two loops be interchanged? Why or why not?
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 5. Repeat the previous four steps for the following loop: for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { A[i][j] = A[i + 1][j + 3]; } } 6. Give an example of a doubly-nested loop with a single statement in the loop body that (a) has an inﬁnite number of distance vectors, and (b) can nevertheless be interchanged. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online