Consider a fully-associative data cache with $32$ blocks of $64$ bytes each. The cache uses $\text{LRU}$ (Least Recently Used) replacement. Consider the following $\text{C}$ code to sum together all of the elements of a $64$ by $64$ two-dimensional array of $64-$ bit double-precision floating point numbers.
double sum (double A[64][64]) {
int i, j;
double sum = 0;
for (i=0; i<64; i++)
for (j=0; j<64; j++)
sum += A [i] [j];
return sum;
}
Assume all blocks in the cache are initially invalid. How many cache misses will result from the code?
- $256$
- $128$
- $1024$
- $512$