Question: As another example of code with potential load-store interactions, consider the following function to copy the contents of one array to another: Suppose a is
As another example of code with potential load-store interactions, consider the following function to copy the contents of one array to another:


Suppose a is an array of length 1,000 initialized so that each element a[i] equals i.
A. What would be the effect of the call copy_array(a+1,a,999)?
B. What would be the effect of the call copy_array(a,a+1,999)?
C. Our performance measurements indicate that the call of part A has a CPE of 1.2 (which drops to 1.0 when the loop is unrolled by a factor of 4), while the call of part B has a CPE of 5.0. To what factor do you attribute this performance difference?
D. What performance would you expect for the call copy_array(a,a,999)?
1 2 3 4 5 6 void copy_array (long *src, long *dest, long n) { } long i; for (i = 0; i
Step by Step Solution
3.39 Rating (161 Votes )
There are 3 Steps involved in it
This problem requires you to analyze the potential loadstore interactions in a program A It will ... View full answer
Get step-by-step solutions from verified subject matter experts
