Question: How can we ( if we can! ) modify the following loops so that they can be maximally parallelized. As a first step identify and

How can we (if we can!) modify the following loops so that they can be maximally parallelized. As a first step identify and clearly describe what sort of dependencies exist in every loop (instruction per instruction and loop iteration per loop iteration). Clearly justify your answer whether the loop is parallelizable or not and if so how. Loop 1: (2 pts) for (i=0;i<100;i++){ A[i]= A[i]* B[i]; /* S1*/ B[i]= A[i]+ c; /* S2*/ A[i]= C[i]* c; /* S3*/ C[i]= D[i]* A[i]; /* S4*/ Loop 2: (2 pts) 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 Programming Questions!