7 b r buck and jk hollingsworth an api for runtime

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: in a stride-1 access pattern. Problem 6.5 Solution: [Pg. 298] The key to solving this problem is to visualize how the array is laid out in memory and then analyze the reference patterns. Function clear1 accesses the array using a stride-1 reference pattern and thus clearly has the best spatial locality. Function clear2 scans each of the Æ structs in order, which is good, but within each struct it hops around in a non-stride-1 pattern at the following offsets from the beginning of the struct: ¼, ½¾, , ½ , , ¾¼. So clear2 has worse spatial locality than clear1. Function clear3 not only hops around within each struct, but it also hops from struct to struct. So clear3 exhibits worse spatial locality than clear2 and clear1. Problem 6.6 Solution: [Pg. 306] The solution is a straightforward application of the definitions of the various cache parameters in Figure 6.26. Not very exciting, but you need to understand how the cache organization induces these partitions in the address bits before you...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online