Next: ...
Up: Motivation: an example
Previous: Accumulate into a scalar
for (i = 0; i < 500; i++)
for (k = 0; k < 500; k++){
r = A[i][k];
for (j = 0; j < 500; j++)
C[i][j] += r * B[k][j];
}
- 45 seconds (5.5 MFLOPS).
- Why is this such a good idea?
- How might a compiler perform this transformation?
- Can we do better still?
Paul H J Kelly
Thu Dec 4 18:15:31 GMT 1997