Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ben s idea is to determine the average memory access time ( AMAT ) for the array references by running the inner loop a large

Bens idea is to determine the average memory access time (AMAT) for the array references by
running the inner loop a large number of times (1000 in the example above), and then dividing
the running time of the program by the number of total array references to get a good estimate of
the AMAT. Ben expects that the L1 access time should be two to three orders of magnitude
smaller than the main memory access time.
For example, in the above case, we have an array of 1024 ints, and we cycle through the array
1000 times. On every pass we read every element (since STEP_SIZE is 1). So this program
does a total of 1,024,000 reads from the array. (It does a few other reads as well, of course, but
the vast majority of the reads are due to the array accesses.) Ben divides the running time of the
program by 1,024,000, and gets a number close to 10ns. Ben concludes that this means the
entire array must have fit in the cache, otherwise the AMAT would have been higher (reflecting
the fact that some elements of the array werent in the cache and had to be fetched from main
memory).
a)[5 points] Why doesnt Ben have to worry about his measurements being distorted by
compulsory misses (first-reference misses) in his program above?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

Students also viewed these Databases questions