Point Five Per Iteration
CS:APP analyses the six loop orderings of an double matrix multiply under one set of assumptions: 32-byte lines (four doubles), large enough that , and a cache too small to hold multiple rows. Two rows of the result are filled in:
| order | inner-loop access pattern | misses per inner iteration |
|---|---|---|
ijk |
A row-wise, B column-wise, C fixed | 1.25 |
jki |
A column-wise, B fixed, C column-wise | 2.00 |
kij |
A fixed, B row-wise, C row-wise | ? |
/* kij */
for (k = 0; k < n; k++) {
for (i = 0; i < n; i++) {
r = a[i][k];
for (j = 0; j < n; j++)
c[i][j] += r * b[k][j];
}
}
What goes in the missing cell?
Sign in to answer questions and track your progress
Sign In