> 文档中心 > 21.cuBLAS开发指南中文版--cuBLAS中的Level-2函数sbmv()

21.cuBLAS开发指南中文版--cuBLAS中的Level-2函数sbmv()


2.6.4. cublassbmv()

在这里插入图片描述

cublasStatus_t cublasSsbmv(cublasHandle_t handle, cublasFillMode_t uplo,      int n, int k, const float  *alpha,      const float  *A, int lda,      const float  *x, int incx,      const float  *beta, float *y, int incy)cublasStatus_t cublasDsbmv(cublasHandle_t handle, cublasFillMode_t uplo,      int n, int k, const double *alpha,      const double *A, int lda,      const double *x, int incx,      const double *beta, double *y, int incy)

此函数执行对称带状矩阵向量乘法:

y = α A x + β y y = \alpha Ax+\beta y y=αAx+βy

其中 A 是具有 k 个子对角线和超对角线的 n*n 对称带状矩阵,并且是向量,x 和 y 是标量。

如果 uplo == CUBLAS_FILL_MODE_LOWER 则对称带状矩阵 A 逐列存储,矩阵的主对角线存储在第 1 行,第 2 行的第一个下对角线(从第一个位置开始),第 3 行的第二个下对角线(开始 在第一个位置)等。因此,一般来说,元素 A(i,j) 存储在内存位置 A(1+i-j,j) 中 i=1,…,n 和 i ∈ [ j , m i n ( m , j + k ) ] i \in[j,min(m,j+k)] i[j,min(m,j+k)] 。 此外,在概念上不对应于带状矩阵(右下角 k*k 三角形)中的元素的数组 A 中的元素不被引用。

如果 uplo == CUBLAS_FILL_MODE_UPPER 则对称带状矩阵 A 逐列存储,矩阵的主对角线存储在第 k+1 行,第 k 行的第一个下对角线(从第一个位置开始),第 k-1 行的第二个下对角线(开始 在第一个位置)等。因此,一般来说,元素 A(1+k+i-j,j) 存储在内存位置 A(1+i-j,j) 中 i=1,…,n 和 i ∈ [ m a x ( 1 , j − k ) , j ] i \in[max(1,j-k),j] i[max(1,jk),j] 。 此外,在概念上不对应于带状矩阵(右下角 k*k 三角形)中的元素的数组 A 中的元素不被引用。

Param. Memory In/out Meaning
handle input handle to the cuBLAS library context.
uplo input indicates if matrix A lower or upper part is stored, the other symmetric part is not referenced and is inferred from the stored elements.
n input number of rows and columns of matrix A.
k input number of sub- and super-diagonals of matrix A.
alpha host or device input scalar used for multiplication.
A device input array of dimension lda x n with lda >= max(1,m).
lda input leading dimension of two-dimensional array used to store matrix A.
x device input vector with n elements if transa == CUBLAS_OP_N and m elements otherwise.
incx input stride between consecutive elements of x.
beta host or device input scalar used for multiplication, if beta==0 then y does not have to be a valid input.
y device in/out vector at least (1+(m-1)*abs(incy)) elements if transa==CUBLAS_OP_N and at least (1+(n-1)*abs(incy)) elements otherwise.
incy input stride between consecutive elements of y.

该函数可能返回的错误值及其含义如下所列。

ErrorValue Meaning
CUBLAS_STATUS_SUCCESS 操作成功完成
CUBLAS_STATUS_NOT_INITIALIZED 库未初始化
CUBLAS_STATUS_INVALID_VALUE 参数 m,n<0 或 incx,incy=0
CUBLAS_STATUS_EXECUTION_FAILED 该功能无法在 GPU 上启动

请参考:

ssbmv, dsbmv

QQ头像吧