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

2.6.10. cublas<t>syr2()

在这里插入图片描述

cublasStatus_t cublasSsyr2(cublasHandle_t handle, cublasFillMode_t uplo, int n,
                           const float           *alpha, const float           *x, int incx,
                           const float           *y, int incy, float           *A, int lda
cublasStatus_t cublasDsyr2(cublasHandle_t handle, cublasFillMode_t uplo, int n,
                           const double          *alpha, const double          *x, int incx,
                           const double          *y, int incy, double          *A, int lda
cublasStatus_t cublasCsyr2(cublasHandle_t handle, cublasFillMode_t uplo, int n,
                           const cuComplex       *alpha, const cuComplex       *x, int incx,
                           const cuComplex       *y, int incy, cuComplex       *A, int lda
cublasStatus_t cublasZsyr2(cublasHandle_t handle, cublasFillMode_t uplo, int n,
                           const cuDoubleComplex *alpha, const cuDoubleComplex *x, int incx,
                           const cuDoubleComplex *y, int incy, cuDoubleComplex *A, int lda

此函数执行对称 rank-2 更新:

A = α ( x y T + y x T ) + A A = \alpha (xy^T + yx^T) + A A=α(xyT+yxT)+A

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

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.
alpha host or device input <type> scalar used for multiplication.
A device input <type> array of dimension lda x n with lda>=max(1,n).
lda input leading dimension of two-dimensional array used to store matrix A.
x device input <type> vector with n elements.
incx input stride between consecutive elements of x.
y device input <type> vector with n elements.
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 上启动

请参考:
ssyr2, dsyr2

猜你喜欢

转载自blog.csdn.net/kunhe0512/article/details/126578022
今日推荐