Question: Dense matri x -vector multiplication . Consider th e multiplication of a dense n x n matrix A with a vector b to yield anther

Dense matrix-vector multiplication .

Consider the multiplication of a dense n x n matrix A with a vector b to yield anther vector y. The ith element y [l] of the product vector is the dot-product of the i th row of A with the input vector b; i.e., Figure 1, the computation of each y[i] can be regarded as a task. As shown in Figure 2, the computation could be decomposed into fewer, say four, tasks where each task computes roughly n/4 of the entries of the vector y.

A b y

0 1 n

Task 1

Task 2

Task n

Figure 1

A b y

0 1 n

Task 1

Task 2

Task n

Figure 2

1)Write a sequential program with C for figure 1.

2) Write a parallel program with OpenMP for figure 2

3) Write a parallel program with OpenAcc for figure 2

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!