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

2.6.9. cublas<t>syr()

在这里插入图片描述

cublasStatus_t cublasSsyr(cublasHandle_t handle, cublasFillMode_t uplo,
                          int n, const float           *alpha,
                          const float           *x, int incx, float           *A, int lda)
cublasStatus_t cublasDsyr(cublasHandle_t handle, cublasFillMode_t uplo,
                          int n, const double          *alpha,
                          const double          *x, int incx, double          *A, int lda)
cublasStatus_t cublasCsyr(cublasHandle_t handle, cublasFillMode_t uplo,
                          int n, const cuComplex       *alpha,
                          const cuComplex       *x, int incx, cuComplex       *A, int lda)
cublasStatus_t cublasZsyr(cublasHandle_t handle, cublasFillMode_t uplo,
                          int n, const cuDoubleComplex *alpha,
                          const cuDoubleComplex *x, int incx, cuDoubleComplex *A, int lda)

此函数执行对称矩阵向量乘法。

y = α x x T + A y = \alpha xx^T+A y=αxxT+A

其中 A 是以列主序存储的 n*n 对称矩阵,x 是向量,而 α \alpha α是标量。

Param.MemoryIn/outMeaning
handleinputhandle to the cuBLAS library context.
uploinputindicates if matrix A lower or upper part is stored, the other symmetric part is not referenced and is inferred from the stored elements.
ninputnumber of rows and columns of matrix A.
alphahost or deviceinput<type> scalar used for multiplication.
Adeviceinput<type> array of dimension lda x n with lda>=max(1,n).
ldainputleading dimension of two-dimensional array used to store matrix A.
xdeviceinput<type> vector with n elements.
incxinputstride between consecutive elements of x.

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

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

请参考:

ssyr, dsyr

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

扫地的小何尚

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

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

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

打赏作者

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

抵扣说明:

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

余额充值