However it is important to realize that the basic

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , using the same block in . Figure 6.49 gives a graphical interpretation of the blocked code from Figure 6.48. The key idea is that it loads a block of into the cache, uses it up, and then discards it. References to enjoy good spatial locality because each sliver is accessed with a stride of 1. There is also good temporal locality because the entire sliver is referenced × Þ times in succession. References to enjoy good temporal locality because the entire × Þ ¢ × Þ block is accessed Ò times in succession. Finally, the references to have good spatial locality because each element of the sliver is written in succession. Notice that references to do not have good temporal locality because each sliver is only accessed one time. 336 CHAPTER 6. THE MEMORY HIERARCHY code/mem/matmult/bmm.c 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 void bijk(array A, array B, array C, int n, int bsize) { int i, j, k, kk, jj; double sum; int en = bsize * (n/bsize); /* Amount that fits evenly into blocks */ for (i = 0; i < n; i++) for (j = 0; j < n; j++) C[i][j] = 0....
View Full Document

Ask a homework question - tutors are online