(A) 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]; 1. How many 64-bit integers can be stored in a 16-byte cache block? 2. Which variable references exhibit temporal locality? 3. Which variable references exhibit spatial locality?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
(A) 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];
1. How many 64-bit integers can be stored in a 16-byte cache block?
2. Which variable references exhibit temporal locality?
3. Which variable references exhibit spatial locality?
(B) 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.
1. How many 64-bit integers can be stored in a 16-byte cache block?
2. Which variable references exhibit temporal locality?
3. Which variable references exhibit spatial locality?
4. 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 cach row contains more than
one element.)
Transcribed Image Text:(A) 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]; 1. How many 64-bit integers can be stored in a 16-byte cache block? 2. Which variable references exhibit temporal locality? 3. Which variable references exhibit spatial locality? (B) 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. 1. How many 64-bit integers can be stored in a 16-byte cache block? 2. Which variable references exhibit temporal locality? 3. Which variable references exhibit spatial locality? 4. 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 cach row contains more than one element.)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Stack
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education