






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A lecture from docsity.com on high performance computing, focusing on memory hierarchy progression and cache. It covers the concept of cache, its hierarchy levels, and its relationship with programming. The lecture includes examples and analyses of cache misses and hits, and their impact on performance. It also discusses the importance of assessing cache related performance issues for important parts of programs.
Typology: Slides
1 / 12
This page cannot be seen from the preview
Don't miss anything!







2
4
5
7 Example 1: Cache Misses and Hits A[2047] 0xDFF8 255 Hit A[2046] 0xDFF0 255 Hit A[2045] 0xDFE8 255 Hit A[2044] 0xDFE0 255 Miss Cold start
A[7] 0xA038 257 Hit A[6] 0xA030 257 Hit A[5] 0xA028 257 Hit A[4] 0xA020 257 Miss Cold start A[3] 0xA018 256 Hit A[2] 0xA010 256 Hit A[1] 0xA008 256 Hit A[0] 0xA000 256 Miss Cold start Cold start miss: we assume that the cache is initially empty. Also called a Compulsory Miss Hit ratio of our loop is 75% -- there are 1536 hits out of 2048 memory accesses This is entirely due to spatial locality of reference. If the loop was preceded by a loop that accessed all array elements, the hit ratio of our loop would be 100%, 25% due to temporal locality and 75% due to spatial locality Cold start miss: we assume that the cache is initially empty. Also called a Compulsory Miss Cold start miss: we assume that the cache is initially empty. Also called a Compulsory Miss
8
10
.. .. 511 Miss Conflict
B[3] 0xE018 256 Miss Conflict A[3] 0xA018 256 Miss Conflict B[2] 0xE010 256 Miss Conflict A[2] 0xA010 256 Miss Conflict B[1] 0xE008 256 Miss Conflict A[1] 0xA008 256 Miss Conflict B[0] 0xE000 256 Miss Cold start A[0] 0xA000 256 Miss Cold start Tag : 18b Index: 9b Offset: 5b
11 Example 2: Cache Hits and Misses B[1023] 0xFFF8 511 Miss Conflict
B[3] 0xE018 256 Miss Conflict A[3] 0xA018 256 Miss Conflict B[2] 0xE010 256 Miss Conflict A[2] 0xA010 256 Miss Conflict B[1] 0xE008 256 Miss Conflict A[1] 0xA008 256 Miss Conflict B[0] 0xE000 256 Miss Cold start A[0] 0xA000 256 Miss Cold start Conflict miss: a miss due to conflicts in cache block requirements from memory accesses of the same program Hit ratio for our program: 0% Source of the problem: the elements of arrays A and B accessed in order have the same cache index Hit ratio would be better if the base address of B is such that these cache indices differ