How would you rewrite the following sequential code so that it can be run as two parallel threads on a dual-core processor ? Try to balance the loads as much as possible between the two threads:
int A[80], B[80], C[80], D[80];
for (i = 0 to 40)
{
A[i] = B[i] * D[2*i];
C[i] = C[i] + B[2*i];
D[i] = 2*B[2*i];
A[i+40] = C[2*i] + B[i];
}
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q1: Applying the send/receive programming model as outlined
Q2: Consider the following code that adds two
Q3: Why should there be stride-access for vector
Q4: Consider a system with two multiprocessors with
Q5: Consider a multi-core processor with heterogeneous cores:
Q6: Suppose we have a dual core chip
Q7: Vector architecture exploits the data-level parallelism to
Q8: Consider a multi-core processor with 64
Q9: Consider the following GPU that consists of
Q11: Besides network bandwidth and bisection bandwidth, two
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents