Question: Computer Architecture Question 1) Do the following loops have a loop-carried dependency? a) for (int i=0; i < 100; i++) { A[i] = B[2*i+4]; B[4*i+5]

Computer Architecture

Question 1) Do the following loops have a loop-carried dependency?

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

A[i] = B[2*i+4];

B[4*i+5] = A[i];

}

b) Are there dependences between S1 and S2? Is this loop parallel? If not, show how to make it parallel.

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

A[i] = A[i] + B[i]; /* S1 */

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

}

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 Databases Questions!