3 ms·
I think this underestimate the idea of transposing one of the matrices. Perhaps it will be discussed in a future article. n = 4096; for(i=0;i<n;i++) {
by gus_massa 13y ago
I think this underestimate the idea of transposing one of the matrices. Perhaps it will be discussed in a future article.
n = 4096;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
for(k=0;k<n;k++)
C[i][j]+=A[i][k]*Bt[j][k];
}
}
Transposing a single matrix is quite fast, and gfortran with -O3 does this trick under the hood, so to see the difference you must use -O0 (or perhaps -O1). (And remember that in Fortran the indices are in the other order.)