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
|
|
|
|
|
Figure 1
A b y
0 1 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started