Question: Problem 2 . In this exercise we look at memory locality properties of matrix computation. The following code is written in C , where elements

Problem 2.
In this exercise we look at memory locality properties of matrix computation. The following code is written in C, where elements within the same row are stored contiguously. Assume each word is a 64-bit integer.
for (i =0; i <8; i++) for (j =0; j <8000; j++) a[i][j]= b[i][0]+ a[j][i];
How many 64-bit integers can be stored in a 16-byte cache block?
Which variable references exhibit temporal locality?
Which variable references exhibit spatial locality?
How many 16-byte cache blocks are needed to store all 64-bit matrix elements being referenced using Cs matrix storage? (Assume each row of matrix b contains more than one element.)

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 Programming Questions!