Purpose of LDA argument in BLAS dgemm?

前端 未结 3 979
时光取名叫无心
时光取名叫无心 2020-12-25 10:55

The Fortran reference implementation documentation states:

*  LDA    - INTEGER.
*           On entry, LDA specifies the first dimension of A as declared
*            


        
3条回答
  •  Happy的楠姐
    2020-12-25 11:34

    The distinction is between the logical size of the first dimensions of the arrays A and B and the physical size. The first is the size of the array that you are using, the second is the value in the declaration, or the physical amount of memory used. Since Fortran is a column major language, the declared sizes of all indices except the last must be known in order to calculate the location of an array element. Notice the FORTRAN 77 style declarations of "A(LDA,),B(LDB,),C(LDC,*)". The declared size of the array can be larger than the portion that you are using; of course it can't be smaller.

提交回复
热议问题