2.6.18. cublashbmv()
cublasStatus_t cublasChbmv(cublasHandle_t handle, cublasFillMode_t uplo,
int n, int k, const cuComplex *alpha,
const cuComplex *A, int lda,
const cuComplex *x, int incx,
const cuComplex *beta,
cuComplex *y, int incy)
cublasStatus_t cublasZhbmv(cublasHandle_t handle, cublasFillMode_t uplo,
int n, int k, const cuDoubleComplex *alpha,
const cuDoubleComplex *A, int lda,
const cuDoubleComplex *x, int incx,
const cuDoubleComplex *beta,
cuDoubleComplex *y, int incy)
y = α A x + β y y = \alpha Ax+\beta y y=αAx+βy
其中 A 是具有 k 个下对角线和上对角线的 nxn Hermitian 带状矩阵,x 和 y 是向量,α 和 β 是标量。
如果 uplo == CUBLAS_FILL_MODE_LOWER
则厄尔米特带状矩阵 A 逐列存储,矩阵的主对角线存储在第 1 行,第一个次对角线存储在第 2 行(从第一个位置开始),第二个次对角线存储在第 3 行(从第一个位置开始) 在第一个位置)等。所以一般来说,元素 A(i,j) 存储在内存位置 A(1+i-j,j) for j=1,…,n and
i
∈
[
j
,
m
i
n
(
m
,
j
+
k
)
]
i\in[j, min(m, j+k)]
i∈[j,min(m,j+k)] 。 此外,数组 A 中在概念上与带状矩阵(右下角的 kxk 三角形)中的元素不对应的元素未被引用。
如果 uplo == CUBLAS_FILL_MODE_UPPER
则厄尔米特带状矩阵 A 逐列存储,矩阵的主对角线存储在第 k+1 行,第一个超对角线存储在第 k 行(从第二个位置开始),第二个超对角线存储在第 k 行 -1(从第三个位置开始)等。所以一般来说,元素 A(i,j) 存储在内存位置 A(1+k+i-j,j) 中,j=1,…n 并且 我> 1。 此外,数组 A 中在概念上与带状矩阵(左上角的 k x k 三角形)中的元素不对应的元素未被引用。
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 Hermitian part is not referenced and is inferred from the stored elements. | |
n | input | number of columns of matrix A. | |
k | input | Number of sub- and super-diagonals of matrix A. | |
alpha | host or device | input | <type> scalar used for multiplication. |
A | device | input | <type> array of dimension lda x n with lda>=kl+ku+1. |
lda | input | leading dimension of two-dimensional array used to store matrix A. | |
x | device | input | <type> 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 | <type> scalar used for multiplication, if beta == 0 then y does not have to be a valid input. |
y | device | in/out | <type> 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 | If n < 0 or k < 0 or if incx = 0 or incy = 0 or if uplo != CUBLAS_FILL_MODE_LOWER, CUBLAS_FILL_MODE_UPPER or if lda < (k + 1) or alpha == NULL or beta == NULL |
CUBLAS_STATUS_EXECUTION_FAILED | 该功能无法在 GPU 上启动 |
详细信息, 请参考: