Gemm and storage order#
Gemm means general matrix multiplication. It is a common routine in linear algebra.
Where means A is tA if 0 and if tA is 1. The coefficients of a matrix are stored in memory in a one dimension array T: where C is the number of columns of matrix A. In that case, the storage is said as row major. In case where R is the number of rows, the storage is column major.
We define a matrix A with , it has I rows, J columns, the memory buffer is M and the matrix order R. In that case, we can express the transpose of this matrix by: If , then .
Let’s use that notation for , and . We note .
This trick can be used to run the computation of matrices using a column major algorithm instead of a row major algorithm by using line (*) as a replacement.