2

While debugging a matrix multiplication error, I arrived at this ATLAS code. This code looks too complex and I don't want to look further inside.(no time.. :) ) It's for general matrix multiplication alpha*A*B + beta*C and I guess the result is stored in C.(or A or B..I'm not sure)

https://sourcecodebrowser.com/atlas/3.6.0/_a_t_l___sgemm_8c_source.html

Could anyone explain how LDA and LDB (lead dimension of A and B) is used? I wonder when M, N, K specifies all the matrix dimension information why lda and ldb are needed. Another question is : Inside the ATL_Sgemm function, ATL_Sgemm function is being called. Is it what is called recursive function?

Chan Kim
  • 5,177
  • 12
  • 57
  • 112
  • Without wading in too deep, it appears the multiplication results are returned in `PT_GEMM_ARGS_T *a_mm;` as part of binary tree `PT_TREE_T tree` returned from the function `ATL_Sgemm` function. The `LDA`, `LDB` **dimensions** look to be used to determine if the multiplication is allowed. (e.g. the rule that matrices of dimensions `m x n` and `n x p` when multiplied results in a matrix of dimension `m x p`. – David C. Rankin Sep 13 '16 at 06:33
  • @DavidC.Rankin it turned out that I was looking at a wrong code. :) it also vaguely looks like the multiplication is being divided into nodes in thread control tree and lda/ldb seems to be used in splitting the rows and columns of A and B respectively to breakdown the workloads. I don't know it needs some background. – Chan Kim Sep 13 '16 at 08:11

0 Answers0