Lecture 5: Caches, wrap up. Virtual Memory.
PreviousLecture 4: The memory hierarchy. Caches.NextLecture 6: The Walls to Sequential Computing. Moore’s Law.
Last updated
Last updated
int sum_array_rows(int** a){
int i, j, sum = 0;
// Option 1: Accessed with locality
for (i = 0; i < M; i++)
for(j = 0; j < N; j++)
sum += a[i][j];
// Option 2: Accessed w/o locality
for (j = 0; j < N; j++)
for (i = 0; i < M; i++)
sum += a[i][j];
return sum;
}