Answered step by step
Verified Expert Solution
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
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
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