how-to-optimize-gemm
how-to-optimize-gemm copied to clipboard
Why are i and j flipped?
Are there any reasons why i
and j
are flipped? I thought it should be a[ (i)*lda + (j) ]
instead of the code below:
#define A(i,j) a[ (j)*lda + (i) ]
Example: Result of matrices a, b and cref (randomized integers):
// a
83.000000 86.000000
77.000000 15.000000
// b
93.000000 35.000000
86.000000 92.000000
// cref
10463.000000 8544.000000
14284.000000 8803.000000
I got the same question!!
https://www.youtube.com/watch?v=PhjildK5oO8
There explaination in the notes: ‘Create macros so that the matrices are stored in column-major order'