Question: Consider a loop like this one: for(i=0; i <100; i++){ A[i] = B[i] + C[i]; C[i] = B[i] + D[i]; C[i+1] = B[i] * D[i];

Consider a loop like this one:

for(i=0; i<100; i++){

A[i] = B[i] + C[i];

C[i] = B[i] + D[i];

C[i+1] = B[i] * D[i];

}

1). Unroll the loop by a factor of 2, write out the code for the new loop

2). What kind of dependences are there in the code of your answer to 1

3). Rewrite the code to eliminate as many dependences as possible.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!