Question: Question-4 (15 points): Dependence analysis of nested loops is a straightforward generalization of the dependence analysis of single loops. Essentially, the index variable becomes an

 Question-4 (15 points): Dependence analysis of nested loops is a straightforward

Question-4 (15 points): Dependence analysis of nested loops is a straightforward generalization of the dependence analysis of single loops. Essentially, the index variable becomes an index vector and the dependence distance becomes a dependence vector. Consider the following example of a double loop: for i = 1 to 10 do for j = 1 to 10 do 5: A(i+1,j-1) = B(i,j) + E(i+1,j+1) T: B(i,j-1) = A(i,j) + 1 U: C(2 i+1,j) = A(i+1,j-1) + 4 V: D(i,j) = C(i,j-1) - 1 end for end for (a) (12 points) Identify all dependences and their types. What is the distance vector of each dependence? For nonuniform dependences, give the minimum and the maximum distance for each component of the vector. (b) (3 points) Can the loop order be swapped, that is, the first loop iterates over j and the second over ?? Explain your answers for full credit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!