Page 1 of 1

can you answer 5.1.1, 5.1.2 .and 5.1.3 only

Posted: Sun Jul 03, 2022 10:00 am
by answerhappygod
can you answer 5.1.1, 5.1.2 .and 5.1.3 only
Can You Answer 5 1 1 5 1 2 And 5 1 3 Only 1
Can You Answer 5 1 1 5 1 2 And 5 1 3 Only 1 (47.42 KiB) Viewed 14 times
Assume memory is byte addressable and words are 64 bits, unless specified otherwise. 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 (1-0; I<8; I++) for (J-0; J<8000; J++) A[1][J]-B[1][0]+A[J]; 5.1.1 [5] <$5.1> How many 64-bit integers can be stored in a 16-byte cache block? 5.1.2 [5] <$5.1> Which variable references exhibit temporal locality? 5.1.3 [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(1,0) +A(J,1); end end 5.1.4 [5] <$5.1> Which variable references exhibit temporal locality? 5.1.5 [5] <$5.1> Which variable references exhibit spatial locality?