Essay
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
The code can be written into two threads...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
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: Suppose we have a dual core chip
Q3: Why should there be stride-access for vector
Q5: Consider the following GPU that consists of
Q6: Consider a multi-core processor with 64
Q7: Besides network bandwidth and bisection bandwidth, two
Q8: Vector architecture exploits the data-level parallelism to
Q9: Consider a multi-core processor with heterogeneous cores:
Q10: Consider the following code that adds two
Q11: Consider a system with two multiprocessors with