Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following is the matrix multiplication code to compute C = A* B, where A, B, C are matrices of size N*N. N is large

image text in transcribed

The following is the matrix multiplication code to compute C = A* B, where A, B, C are matrices of size N*N. N is large enough s multiple rows cannot fit in cache. Assume row major store organization as default. The size of cach cache line is large enough to st elements of a matrix. Remember data is read and written into cache as cache lines, i.e. each read can bring in 4 elements. for (1=1) Ni++) for (=NiH): Sum = 0 0 for k=1. k++) sum = sum + Alu] B[ku] Chilli = sum Given this code, consider the inner-most iteration to compute one element of C. What is the average number of cache misses for re matrix A and matrix B for each inner-most iteration ? Justify your answer with any necessary diagrams to show access patterns for A and the inner-most loop. [Marks: 31 The following is the matrix multiplication code to compute C = A* B, where A, B, C are matrices of size N*N. N is large enough s multiple rows cannot fit in cache. Assume row major store organization as default. The size of cach cache line is large enough to st elements of a matrix. Remember data is read and written into cache as cache lines, i.e. each read can bring in 4 elements. for (1=1) Ni++) for (=NiH): Sum = 0 0 for k=1. k++) sum = sum + Alu] B[ku] Chilli = sum Given this code, consider the inner-most iteration to compute one element of C. What is the average number of cache misses for re matrix A and matrix B for each inner-most iteration ? Justify your answer with any necessary diagrams to show access patterns for A and the inner-most loop. [Marks: 31

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

Bachelors degree in Information Systems or Statistics

Answered: 1 week ago