Next: Examine the inner loop
Up: Chapter1
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];
}
- Why might this be a good idea?
- 45 seconds (5.5 MFLOPS).
- How might a compiler perform this transformation?
- Can we do better still?
Paul H J Kelly
Thu Feb 6 22:02:49 GMT 1997