how-to-optimize-gemm icon indicating copy to clipboard operation
how-to-optimize-gemm copied to clipboard

Why are i and j flipped?

Open minhkhang1795 opened this issue 4 years ago • 3 comments

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 

minhkhang1795 avatar Mar 14 '20 05:03 minhkhang1795

I got the same question!!

rayjan0114 avatar Mar 31 '21 06:03 rayjan0114

https://www.youtube.com/watch?v=PhjildK5oO8

marvin-Yu avatar Feb 23 '22 12:02 marvin-Yu

There explaination in the notes: ‘Create macros so that the matrices are stored in column-major order'

poemon1 avatar Sep 06 '23 08:09 poemon1