GBMV, HBMV and SBMV use MatVec directly, passing their own buffers into the function, unlike TBMV which passes a scratch buffer for just vector X into MatVec. This means that for all 4 of these operations TestMatrixA is applied directly on the user provided buffer for the A matrix.
The required buffer size of all A matrices is calculated as (ld * (two - 1) + one + offset) * sizeof(T) which for GBMV, HBMV, SBMV and TBMV called with row major matrices expands to (a_ld * (m - 1) + kl + ku + 1 + a_offset) * sizeof(T). However, the BLAS interface defines the size of matrix A for all 4 routines as a_ld * n which means that user buffers can lead to kInsufficientMemoryA errors even though they hold enough memory according to the interface spec.
For HBMV, SBMV and TBMV this issue is somewhat hidden by passing the value of n into MatVec's m parameter so the error is only encountered when (kl + ku + 1) > a_ld.
GBMV, HBMV and SBMV use
MatVecdirectly, passing their own buffers into the function, unlike TBMV which passes a scratch buffer for just vector X intoMatVec. This means that for all 4 of these operationsTestMatrixAis applied directly on the user provided buffer for the A matrix.The required buffer size of all A matrices is calculated as
(ld * (two - 1) + one + offset) * sizeof(T)which for GBMV, HBMV, SBMV and TBMV called with row major matrices expands to(a_ld * (m - 1) + kl + ku + 1 + a_offset) * sizeof(T). However, the BLAS interface defines the size of matrix A for all 4 routines asa_ld * nwhich means that user buffers can lead tokInsufficientMemoryAerrors even though they hold enough memory according to the interface spec.For HBMV, SBMV and TBMV this issue is somewhat hidden by passing the value of
nintoMatVec'smparameter so the error is only encountered when(kl + ku + 1) > a_ld.