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 32‐bit integer. (hint: 2D array in C stores in row first order).
For (I = 0; I < 8; I++)
For (J = 0; J < 8000; J++)
A[I][J] = B[I][0] + A[J][I];
(1) How many 32‐bit integers can be stored in a 16‐byte cache block?
(2) References to which variables exhibit temporal locality?
(3) References to which variables exhibit spatial locality?