In this exercise we look at memory locality properties of matrix computation. The following code is written in C, where elements within the same row are stored contiguously. Assume each word is a 64-bit integer. for (I = 0; I < 8; I++) for (J = 0; J < 8000; J++) A[I][J] = B[I][0] + A[J][I]; (a) How many 64-bit integers can be stored in a 16-byte cache block? (b) Which variable references exhibit temporal locality? (c) Which variable references exhibit spatial locality? (d) Locality is affected by both the reference order and data layout. The same computation can also be written below in Matlab, which differs from C in that it stores matrix elements within the same column contiguously in memory. for I 1:8 for J 1:8000 A(I,J) = B(1,0) + A(J,I); end end (e) Which variable references exhibit temporal locality? (f) Which variable references exhibit spatial locality? (g) How many 16-byte cache blocks are needed to store all 64-bit matrix elements being referenced using Matlab's matrix storage? How many using C's matrix storage? (Assume each row contains more than one element.)
In this exercise we look at memory locality properties of matrix computation. The following code is written in C, where elements within the same row are stored contiguously. Assume each word is a 64-bit integer. for (I = 0; I < 8; I++) for (J = 0; J < 8000; J++) A[I][J] = B[I][0] + A[J][I]; (a) How many 64-bit integers can be stored in a 16-byte cache block? (b) Which variable references exhibit temporal locality? (c) Which variable references exhibit spatial locality? (d) Locality is affected by both the reference order and data layout. The same computation can also be written below in Matlab, which differs from C in that it stores matrix elements within the same column contiguously in memory. for I 1:8 for J 1:8000 A(I,J) = B(1,0) + A(J,I); end end (e) Which variable references exhibit temporal locality? (f) Which variable references exhibit spatial locality? (g) How many 16-byte cache blocks are needed to store all 64-bit matrix elements being referenced using Matlab's matrix storage? How many using C's matrix storage? (Assume each row contains more than one element.)
Chapter3: Data Representation
Section: Chapter Questions
Problem 1PE
Related questions
Question
Answer only D E F and G.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning