tpoisonooo/how-to-optimize-gemm

Row-majored or Column-majored

LeoLai930603 opened this issue · 2 comments

I found the definition of MMult0.c and MMult1.c for multi-dimensional array storage, would you like to take a look and see whether both of them are correct?
For MMult0.c

#define A(i,j) a[ (i)*lda + (j) ]
#define B(i,j) b[ (i)*ldb + (j) ]
#define C(i,j) c[ (i)*ldc + (j) ]

For MMult1.c

#define A(i,j) a[ (j)*lda + (i) ]
#define B(i,j) b[ (j)*ldb + (i) ]
#define C(i,j) c[ (j)*ldc + (i) ]

As you see, the positions of i and j are inverted.

Well, MMult1.c seems not correct, I would fix it latter.
Any PR would be well received.

Fixed.