Consider the following function for computing the product of an array of n double-precision numbers. We have

Question:

Consider the following function for computing the product of an array of n double-precision numbers. We have unrolled the loop by a factor of 3.

double aprod (double a[1, long n) { } long 1; double x, y, z; double r = 1; for (i = 0; i < n-2; i+= 3) { X =

For the line labeled “Product computation,” we can use parentheses to create five different associations of the computation, as follows:

r = r = ((r * x) * y) *z; /* A1 */ (r* (x * y)) * z; /* A2 */ r = r * ((x * y) * z); /* A3 */ r = r * (x * (y

Assume we run these functions on a machine where floating-point multiplication has a latency of 5 clock cycles. Determine the lower bound on the CPE set by the data dependencies of the multiplication.

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: