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

2.6.19. cublashpmv()

在这里插入图片描述

cublasStatus_t cublasChpmv(cublasHandle_t handle, cublasFillMode_t uplo,
                           int n, const cuComplex       *alpha,
                           const cuComplex       *AP,
                           const cuComplex       *x, int incx,
                           const cuComplex       *beta,
                           cuComplex       *y, int incy)
cublasStatus_t cublasZhpmv(cublasHandle_t handle, cublasFillMode_t uplo,
                           int n, const cuDoubleComplex *alpha,
                           const cuDoubleComplex *AP,
                           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 是以压缩格式存储的 nxn Hermitian 矩阵,x 和 y 是向量,α 和 β 是标量。

如果 uplo == CUBLAS_FILL_MODE_LOWER 那么Hermitian矩阵 A 的下三角部分的元素被逐列无间隙地打包在一起,使得元素 A(i,j) 存储在内存位置 AP[i+((2* n-j+1)*j)/2] 对于 j=1,…,n 和 i>=j。 因此,打包格式只需要 n(n+1)/2 个元素进行存储。

如果 uplo == CUBLAS_FILL_MODE_UPPER 则将厄米矩阵 A 的上三角部分的元素逐列无间隙地打包在一起,使得元素 A(i,j) 存储在内存位置 AP[i+(j*( j+1))/2] 对于 j=1,…,n 和 i<=j 。 因此,打包格式只需要 n(n+1)/2 个元素进行存储。

Param.MemoryIn/outMeaning
handleinputhandle to the cuBLAS library context.
uploinputIndicates if matrix A lower or upper part is stored, the other Hermitian part is not referenced and is inferred from the stored elements.
ninputnumber of columns of matrix A.
alphahost or deviceinput<type> scalar used for multiplication.
APdeviceinput<type> array with A stored in packed format. The imaginary parts of the diagonal elements are assumed to be zero.
xdeviceinput<type> vector with n elements if transa == CUBLAS_OP_N and m elements otherwise.
incxinputstride between consecutive elements of x.
betahost or deviceinput<type> scalar used for multiplication, if beta == 0 then y does not have to be a valid input.
ydevicein/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.
incyinputstride between consecutive elements of y.

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

ErrorValueMeaning
CUBLAS_STATUS_SUCCESS操作成功完成
CUBLAS_STATUS_NOT_INITIALIZED库未初始化
CUBLAS_STATUS_INVALID_VALUEIf 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 上启动

详细信息, 请参考:

chpmv, zhpmv

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

扫地的小何尚

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值