This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ize goes up! How long does this happen? • Naive guess: happens as long as all three matrices ﬁt in
cache (N ≤ sqrt(C/3)) • On Itanium: should happen when N ≤ 104 Tuesday, February 2, 2010 Missrate regimes
•
• •
• When a matrix ﬁts entirely in cache, it experiences temporal and
spatial locality • Misses: N2/b If a matrix is being walked in rowmajor order, it may experience
spatial locality, but not temporal locality •
• Only get a miss 1 out of b accesses
Misses: N3/b Other times, a matrix experiences no locality •
• Every access misses
Misses: N3 (What about a matrix that only experiences temporal locality?) Tuesday, February 2, 2010 Predicting miss rates
• To predict a miss rate, we need to determine, for each
matrix: • Whether it experiences no locality, spatial locality, or
both spatial and temporal locality • At which point the matrix transitions between the
various regimes Tuesday, February 2, 2010 Stack distance
•
• Introduced by Mattson et al. in 1970
The stack distance of a memory location is the number of
distinct cache lines touched between successive accesses to
that location • Called stack distance because it can be calculated with a
reuse stack • Also called reuse distance Tuesday, February 2, 2010 Stack distance
• We introduce two types of stack distance: • dt(M): the stack distance between successive accesses to
a given element of M •
• • ds(M): the minimum stack distance between successive
accesses to distinct elements of M that lay on the same
cache line If C < b* dt(M), matrix does not have temporal locality • By the time we touch the same element again, we’ve
brought in too many other elements into cache If C < b*ds(M), matrix does not have spatial locality Tuesday, February 2, 2010 C...
View
Full
Document
This document was uploaded on 04/05/2014.
 Spring '14

Click to edit the document details