In the previous dotprod example, what fraction of the total references to x and y will be

Question:

In the previous dotprod example, what fraction of the total references to x and y will be hits once we have padded array x?

Example:

For example, instead of defining x to be float x[8], we define it to be float x[12]. Assuming y starts immediately after x in memory, we have the following mapping of array elements to sets: 

Element x [0] x [1] x [2] x [3] x [4] x [5] x [6] x [7] Address 0 4 8 12 16 20 24 28 Set index 0 0 0 0 1 1 1

With the padding at the end of x, x[i] and y[i] now map to different sets, which eliminates the thrashing conflict misses.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: