Ask Question
27 January, 15:38

In this exercise we look at memory locality properties of matrix computation. Th e following code is written in C, where elements within the same row are stored contiguously. Assume each word is a 32-bit integer.

for (I=0; I<8; I++)

for (J=0; J<8000; J++)

A[I][J]=B[I][0]+A[J][I];

References to which variables exhibit temporal locality?

+5
Answers (1)
  1. 27 January, 17:11
    0
    temporal locality can be defined as: when a particular memory is referenced or accessed several times within a specific period of time. In the question, i think the variable that exhibit temporal locality are I, J and 0 (all the variable). This is because the variable J and 0 are accessed several times within the loop. I would not have been part of it, but in the A[I][J]=B[I][0]+A[J][I], the variable "I" is also accessed in the addition. this is why it is part of the temporal locality.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “In this exercise we look at memory locality properties of matrix computation. Th e following code is written in C, where elements within ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers