cublassyr()
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. | 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 | scalar used for multiplication. |
A | device | input | 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 | vector with n elements. |
incx | input | stride between consecutive elements of x. |
该函数可能返回的错误值及其含义如下所列。
ErrorValue | Meaning |
---|---|
CUBLAS_STATUS_SUCCESS | 操作成功完成 |
CUBLAS_STATUS_NOT_INITIALIZED | 库未初始化 |
CUBLAS_STATUS_INVALID_VALUE | 参数 m,n<0 或 incx,incy=0 |
CUBLAS_STATUS_EXECUTION_FAILED | 该功能无法在 GPU 上启动 |
请参考: