Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5 . 1 In this exercise we look at memory locality properties of matrix computation. The following code is written in C , where elements

5.1 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)[5]<5.1> How many 64-bit integers can be stored in a 16-byte cache
block?
B)[5]<5.1> Which variable references exhibit temporal locality?
C)[5]<5.1> Which variable references exhibit spatial locality?
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(I,0)+A(J,I);
end
end
D)[5]<5.1> Which variable references exhibit temporal locality?
E)[5]<5.1> Which variable references exhibit spatial locality?

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions