CS 3214 Midterm: CS3214 MidtermCS3214S11

58 views12 pages
31 Jan 2019
Course
Professor

Document Summary

Midterm: memory layout and locality (25 pts) The recomputation of sum[i] is executed n times in succession during each pass through the inner loop. Note: the question is about locality wrt code accesses, not data accesses. Answers that referred to variables, like i or sum[i] are talking about data accesses. The inner loop traverses sum[] with stride 1, indicating good spatial locality wrt sum[]. Assume that the dimensions of the arrays are large in relation to the size of the cache. Note: a cache line is one storage unit of the cache, not the entire cache, which would consist of many lines. When data is fetched into the cache, a whole line is populated (from ram) at once. S[] is traversed with stride 1, so a line of cache would store 12 successive, relevant elements of s[]; we should expect a pattern of 1 miss followed by 11 hits for s[].

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers