Purpose of LDA argument in BLAS dgemm?

前端 未结 3 960
时光取名叫无心
时光取名叫无心 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条回答
  •  隐瞒了意图╮
    2020-12-25 11:47

    The LDA parameter in BLAS is effectively the stride of the matrix as it is laid out in linear memory. It is perfectly valid to have an LDA value which is larger than the leading dimension of the matrix which is being operated on. Typical cases where it is either useful or necessary to use a larger LDA value are when you are operating on a sub matrix from a larger dense matrix, and when hardware or algorithms offer performance advantages when storage is padded to round multiples of some optimal size (cache lines or GPU memory transaction size, or load balance in multiprocessor implementations, for example).

提交回复
热议问题