Answered step by step
Verified Expert Solution
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 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 L 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 ints and we cycle through the array
times. On every pass we read every element since STEPSIZE is So this program
does a total of 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 and gets a number close to ns 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 points Why doesnt Ben have to worry about his measurements being distorted by
compulsory misses firstreference misses in his program above?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started