BLAS++ 2024.05.31
BLAS C++ API
Loading...
Searching...
No Matches
syr2k: Symmetric rank 2k update

\(C = \alpha A B^T + \alpha B A^T + \beta C\) where \(C\) is symmetric More...

Functions

template<typename TA , typename TB , typename TC >
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, scalar_type< TA, TB, TC > alpha, TA const *A, int64_t lda, TB const *B, int64_t ldb, scalar_type< TA, TB, TC > beta, TC *C, int64_t ldc)
 Symmetric rank-k update:
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< float > const &alpha, std::vector< float * > const &Aarray, std::vector< int64_t > const &lda, std::vector< float * > const &Barray, std::vector< int64_t > const &ldb, std::vector< float > const &beta, std::vector< float * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info)
 CPU, variable-size batched, float version.
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< double > const &alpha, std::vector< double * > const &Aarray, std::vector< int64_t > const &lda, std::vector< double * > const &Barray, std::vector< int64_t > const &ldb, std::vector< double > const &beta, std::vector< double * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info)
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< std::complex< float > > const &alpha, std::vector< std::complex< float > * > const &Aarray, std::vector< int64_t > const &lda, std::vector< std::complex< float > * > const &Barray, std::vector< int64_t > const &ldb, std::vector< std::complex< float > > const &beta, std::vector< std::complex< float > * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info)
 CPU, variable-size batched, complex<float> version.
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< std::complex< double > > const &alpha, std::vector< std::complex< double > * > const &Aarray, std::vector< int64_t > const &lda, std::vector< std::complex< double > * > const &Barray, std::vector< int64_t > const &ldb, std::vector< std::complex< double > > const &beta, std::vector< std::complex< double > * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info)
 CPU, variable-size batched, complex<double> version.
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< float > const &alpha, std::vector< float * > const &Aarray, std::vector< int64_t > const &lda, std::vector< float * > const &Barray, std::vector< int64_t > const &ldb, std::vector< float > const &beta, std::vector< float * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info, blas::Queue &queue)
 GPU device, variable-size batched, float version.
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< double > const &alpha, std::vector< double * > const &Aarray, std::vector< int64_t > const &lda, std::vector< double * > const &Barray, std::vector< int64_t > const &ldb, std::vector< double > const &beta, std::vector< double * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info, blas::Queue &queue)
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< std::complex< float > > const &alpha, std::vector< std::complex< float > * > const &Aarray, std::vector< int64_t > const &lda, std::vector< std::complex< float > * > const &Barray, std::vector< int64_t > const &ldb, std::vector< std::complex< float > > const &beta, std::vector< std::complex< float > * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info, blas::Queue &queue)
 GPU device, variable-size batched, complex<float> version.
 
void blas::batch::syr2k (blas::Layout layout, std::vector< blas::Uplo > const &uplo, std::vector< blas::Op > const &trans, std::vector< int64_t > const &n, std::vector< int64_t > const &k, std::vector< std::complex< double > > const &alpha, std::vector< std::complex< double > * > const &Aarray, std::vector< int64_t > const &lda, std::vector< std::complex< double > * > const &Barray, std::vector< int64_t > const &ldb, std::vector< std::complex< double > > const &beta, std::vector< std::complex< double > * > const &Carray, std::vector< int64_t > const &ldc, size_t batch_size, std::vector< int64_t > &info, blas::Queue &queue)
 GPU device, variable-size batched, complex<double> version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, float alpha, float const *A, int64_t lda, float const *B, int64_t ldb, float beta, float *C, int64_t ldc, blas::Queue &queue)
 GPU device, float version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, double alpha, double const *A, int64_t lda, double const *B, int64_t ldb, double beta, double *C, int64_t ldc, blas::Queue &queue)
 GPU device, double version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, std::complex< float > alpha, std::complex< float > const *A, int64_t lda, std::complex< float > const *B, int64_t ldb, std::complex< float > beta, std::complex< float > *C, int64_t ldc, blas::Queue &queue)
 GPU device, complex<float> version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, std::complex< double > alpha, std::complex< double > const *A, int64_t lda, std::complex< double > const *B, int64_t ldb, std::complex< double > beta, std::complex< double > *C, int64_t ldc, blas::Queue &queue)
 GPU device, complex<double> version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, float alpha, float const *A, int64_t lda, float const *B, int64_t ldb, float beta, float *C, int64_t ldc)
 CPU, float version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, double alpha, double const *A, int64_t lda, double const *B, int64_t ldb, double beta, double *C, int64_t ldc)
 CPU, double version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, std::complex< float > alpha, std::complex< float > const *A, int64_t lda, std::complex< float > const *B, int64_t ldb, std::complex< float > beta, std::complex< float > *C, int64_t ldc)
 CPU, complex<float> version.
 
void blas::syr2k (blas::Layout layout, blas::Uplo uplo, blas::Op trans, int64_t n, int64_t k, std::complex< double > alpha, std::complex< double > const *A, int64_t lda, std::complex< double > const *B, int64_t ldb, std::complex< double > beta, std::complex< double > *C, int64_t ldc)
 CPU, complex<double> version.
 

Detailed Description

\(C = \alpha A B^T + \alpha B A^T + \beta C\) where \(C\) is symmetric

Function Documentation

◆ syr2k()

template<typename TA , typename TB , typename TC >
void blas::syr2k ( blas::Layout  layout,
blas::Uplo  uplo,
blas::Op  trans,
int64_t  n,
int64_t  k,
scalar_type< TA, TB, TC >  alpha,
TA const *  A,
int64_t  lda,
TB const *  B,
int64_t  ldb,
scalar_type< TA, TB, TC >  beta,
TC *  C,
int64_t  ldc 
)

Symmetric rank-k update:

\[ C = \alpha A B^T + \alpha B A^T + \beta C, \]

or

\[ C = \alpha A^T B + \alpha B^T A + \beta C, \]

where alpha and beta are scalars, C is an n-by-n symmetric matrix, and A and B are n-by-k or k-by-n matrices.

Generic implementation for arbitrary data types.

Parameters
[in]layoutMatrix storage, Layout::ColMajor or Layout::RowMajor.
[in]uploWhat part of the matrix C is referenced, the opposite triangle being assumed from symmetry:
  • Uplo::Lower: only the lower triangular part of C is referenced.
  • Uplo::Upper: only the upper triangular part of C is referenced.
[in]transThe operation to be performed:
  • Op::NoTrans: \(C = \alpha A B^T + \alpha B A^T + \beta C\).
  • Op::Trans: \(C = \alpha A^T B + \alpha B^T A + \beta C\).
  • In the real case, Op::ConjTrans is interpreted as Op::Trans. In the complex case, Op::ConjTrans is illegal (see her2k: Hermitian rank 2k update instead).
[in]nNumber of rows and columns of the matrix C. n >= 0.
[in]k
  • If trans = NoTrans: number of columns of the matrix A. k >= 0.
  • Otherwise: number of rows of the matrix A. k >= 0.
[in]alphaScalar alpha. If alpha is zero, A and B are not accessed.
[in]A
  • If trans = NoTrans: the n-by-k matrix A, stored in an lda-by-k array [RowMajor: n-by-lda].
  • Otherwise: the k-by-n matrix A, stored in an lda-by-n array [RowMajor: k-by-lda].
[in]ldaLeading dimension of A.
  • If trans = NoTrans: lda >= max(1, n) [RowMajor: lda >= max(1, k)],
  • Otherwise: lda >= max(1, k) [RowMajor: lda >= max(1, n)].
[in]B
  • If trans = NoTrans: the n-by-k matrix B, stored in an ldb-by-k array [RowMajor: n-by-ldb].
  • Otherwise: the k-by-n matrix B, stored in an ldb-by-n array [RowMajor: k-by-ldb].
[in]ldbLeading dimension of B.
  • If trans = NoTrans: ldb >= max(1, n) [RowMajor: ldb >= max(1, k)],
  • Otherwise: ldb >= max(1, k) [RowMajor: ldb >= max(1, n)].
[in]betaScalar beta. If beta is zero, C need not be set on input.
[in]CThe n-by-n symmetric matrix C, stored in an lda-by-n array [RowMajor: n-by-lda].
[in]ldcLeading dimension of C. ldc >= max(1, n).