Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Matrix - vector multiplication, denoted as y = A x , is a very common operation in linear algebra and has a variety of real

Matrix-vector multiplication, denoted as y=Ax, is a very common operation in linear algebra and has a
variety of real-world applications (e.g. graph theory, deep learning, quantum mechanics, etc.). Each yi entry
is computed as Ai0x0+Ai1x1+dots+Aijxj.
Suppose you are a researcher with access to high-performance computing (HPC) systems at ARCH (Advanced
Research Computing at Hopkins). You are tasked to implement an optimized the matrix-vector routine in C.
An example declaration of your function follows below:// y is an m-length vector (array)
// A is an m by n matrix (2d array)
// x is an n-length vector (array)
void matrix_vector_multiply(double* y, double* A, double* x, int m, int n);An efficient routine will make good use of pipelineing and caches. Assume for this task that all matrix-vector
multiplication routines considered have equivalent algorithmic efficiency.
(a) Assume A is too big to fit into cache at once, but x and y could potentially fit into cache simultaneously
with some room left over (i.e.m+n is much less than mn). What is the best order to iterate over the
entries of A??1 Why? Give your answer in two to four sentences long.
(b) Does matrix-vector multiplication present any pipelining concerns (e.g. data hazards, control hazards)?
Why or why not? Give your answer in two to four sentences long.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions