[理工] [計組] 白算盤第五章習題

看板Grad-ProbAsk作者 (阿che)時間15年前 (2010/06/05 14:15), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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 by contiguously storing matrix elements within the same column. a. for I = 1:8000 for J = 1:8 A(I,J) = B(J,0) + A(J,I); end end b. for J = 1:8 for I = 1:8000 A(I,J) = B(J,0) + A(J,I); end end How many 16 byte cache lines are needed to store all 32-bit matrix elements being referenced? 解答: a 3186 = 8 * (800/4) * 2 – 8 * (8/4) + 8/4 b 3596 = 8 * (800/4) * 2 – 8 * (8/4) + 8000/4 想請教板上的各位這是怎麼解出來的? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.31.133.241 ※ 編輯: aerystyle 來自: 61.31.133.241 (06/05 14:17)
文章代碼(AID): #1C2Uk0bW (Grad-ProbAsk)