ps6-sol - ECE 468 & 573 Problem Set 7: Dependence...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem Set 7: 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]; } } Answer: Solid lines = flow dependences, dashed lines = anti dependences, dotted lines = output dependences. 2. Show the distance vector(s) for the loop from the previous problem. Answer: Flow dependence: (1, -3), Anti dependence (0, 2) 3. Show the direction vector(s) for the loop. Answer: Flow dependence: (+, -), Anti dependence (0, +) 4. Can the two loops be interchanged? Why or why not? Answer: No, because the flow dependence is a (+, -) dependence, and it will be broken by interchange. 5. Repeat the previous four steps for the following loop: 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { A[i][j] = A[i + 1][j + 3]; } } Answer: Solid lines = flow dependences, dashed lines = anti dependences, dotted lines = output dependences. There is an
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 3

ps6-sol - ECE 468 &amp; 573 Problem Set 7: Dependence...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online