ps8-sol - ECE 468 Problem Set 8: Dependence analysis 1....

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

View Full Document Right Arrow Icon
ECE 468 Problem Set 8: Dependence analysis 1. Consider the following code: for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; j++) { A[i][j] = A[i - 1][j + 1] + A[i + 1][j + 1]; } } (a) Draw the iteration space graph for this loop nest. Use solid arrows for flow dependences, dashed arrows for anti-dependences and dotted arrows for output dependences. Answer: 0 1 2 3 4 5 0 1 2 3 4 5 (b) Give the distance and direction vectors for each type of dependence. Answer: Flow: (1 , - 1) or (+ , - ). Anti: (1 , 1) or (+ , +) (c) Can we perform loop interchange on this loop? Why or why not? Answer: No, we cannot. The flow dependence would turn into an anti de- pendence if we performed loop interchange. 2. Consider the following code: 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 < N; i++) { for (int j = 0; j < N; j++) { A[j][i] = A[j - 1][i - 1] + B[i][j]; A[j+1][i] = B[i + 1][j - 1]; } } (a) Give the distance and direction vectors for the dependences in this loop. Indi- cate which array the dependences are on. Answer:
Background image of page 2
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 / 2

ps8-sol - ECE 468 Problem Set 8: Dependence analysis 1....

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

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