Cache Memory
1 Cache Memory
Outline Cache mountain Matrix multiplication Suggested Reading: 6.6, 6.7
2 Outline • Cache mountain • Matrix multiplication • Suggested Reading: 6.6, 6.7
6.6 Putting it Together: The Impact of Caches on Program Performance 6.6.1 The Memory Mountain
3 6.6 Putting it Together: The Impact of Caches on Program Performance 6.6.1 The Memory Mountain
The memory Mountain P512 Read throughput (read bandwidth) The rate that a program reads data from the memory system Memory mountain A two-dimensional function of read bandwidth versus temporal and spatial locality Characterizes the capabilities of the memory system for each computer
4 The Memory Mountain P512 • Read throughput (read bandwidth) – The rate that a program reads data from the memory system • Memory mountain – A two-dimensional function of read bandwidth versus temporal and spatial locality – Characterizes the capabilities of the memory system for each computer
Memory mountain main routine Figure 6.41 P513 / mountain c- Generate the memory mountain. #define minbytes(1 <<10)/working set size ranges from 1 KB*/ #define maxbYtes (1 < 23)/...up to 8 MB*/ #define maxstride 16 / strides range from 1 to 16*/ #define maXelems maXbytes/sizeof(int) int data MAXELEMSI: The array well be traversing
5 Memory mountain main routine Figure 6.41 P513 /* mountain.c - Generate the memory mountain. */ #define MINBYTES (1 << 10) /* Working set size ranges from 1 KB */ #define MAXBYTES (1 << 23) /* ... up to 8 MB */ #define MAXSTRIDE 16 /* Strides range from 1 to 16 */ #define MAXELEMS MAXBYTES/sizeof(int) int data[MAXELEMS]; /* The array we'll be traversing */