







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








2
4
5
X Y
Z
/ Dot product inner loop
7
double X[N][N], Y[N][N], Z[N][N];
for (i=0; i<N; i++)
for (k=0; k<N; k++)
X[i][j] += Y[i][k] * Z[k][j];
for (j=0; j<N; j++)
for (k=0; k<N; k+=2)
X[i][j] += Y[i][k]Z[k][j] + Y[i][k+1]Z[k+1][j];
Unroll k loop
8
double X[N][N], Y[N][N], Z[N][N];
for (i=0; i<N; i++)
for (k=0; k<N; k++)
X[i][j] += Y[i][k] * Z[k][j];
for (j=0; j<N; j++) Unroll j loop
Blocking or Tiling
Unroll k loop
for (j=0; j<N; j+=2)
for (k=0; k<N; k+=2){
X[i][j] += Y[i][k]Z[k][j] +Y[i][k+1]Z[k+1][j];
X[i][[j+1] += Y[i][k]Z[k][j+1] +Y[i][k+1]Z[k+1][j+1];
10
K
K
J
11
13
Flush cache on context switch, or
Include Process id as part of each cache directory entry
Virtual addresses that translate to same physical address
More than one copy of a block in cache …