cuLite v0.3.1
A lite CUDA C++ Interface
Loading...
Searching...
No Matches
Inner/Outer product Operations

Dot products and rank-1 updates. More...

Functions

template<typename T_Scalar>
T_Scalar culite::ops::dot (const dns::XxVector< T_Scalar > &x, const dns::XxVector< T_Scalar > &y, CuBlasHandler &cublasHandler=globalCuBlasHandler())
 Calculate vector dot product.
template<typename T_Scalar>
T_Scalar culite::ops::dotc (const dns::XxVector< T_Scalar > &x, const dns::XxVector< T_Scalar > &y, CuBlasHandler &cublasHandler=globalCuBlasHandler())
 Calculate vector conjugate dot product.
template<typename T_Scalar>
void culite::ops::outer (T_Scalar alpha, const dns::XxVector< T_Scalar > &x, const dns::XxVector< T_Scalar > &y, dns::XxMatrix< T_Scalar > &A, CuBlasHandler &cublasHandler=globalCuBlasHandler())
 Update a matrix with a vector outer product.
template<typename T_Scalar>
void culite::ops::outerc (T_Scalar alpha, const dns::XxVector< T_Scalar > &x, const dns::XxVector< T_Scalar > &y, dns::XxMatrix< T_Scalar > &A, CuBlasHandler &cublasHandler=globalCuBlasHandler())
 Update a matrix with a conjugate vector outer product.

Detailed Description

Dot products and rank-1 updates.

Function Documentation

◆ dot()

template<typename T_Scalar>
T_Scalar culite::ops::dot ( const dns::XxVector< T_Scalar > & x,
const dns::XxVector< T_Scalar > & y,
CuBlasHandler & cublasHandler = globalCuBlasHandler() )

Calculate vector dot product.

Performs the operation \( x^T \cdot y \).

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]xThe input vector (must have device data).
[in]yThe input vector (must have device data).
[in]cublasHandlerThe cuBLAS handler for GPU operations (defaults to global handler).
Returns
The dot product value on host.

◆ dotc()

template<typename T_Scalar>
T_Scalar culite::ops::dotc ( const dns::XxVector< T_Scalar > & x,
const dns::XxVector< T_Scalar > & y,
CuBlasHandler & cublasHandler = globalCuBlasHandler() )

Calculate vector conjugate dot product.

Performs the operation \( x^H \cdot y \).

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]xThe input vector (must have device data).
[in]yThe input vector (must have device data).
[in]cublasHandlerThe cuBLAS handler for GPU operations (defaults to global handler).
Returns
The conjugate dot product value on host.

◆ outer()

template<typename T_Scalar>
void culite::ops::outer ( T_Scalar alpha,
const dns::XxVector< T_Scalar > & x,
const dns::XxVector< T_Scalar > & y,
dns::XxMatrix< T_Scalar > & A,
CuBlasHandler & cublasHandler = globalCuBlasHandler() )

Update a matrix with a vector outer product.

Performs the operation \( A = A + \alpha \cdot x y^T \). A can be General/Symmetric/Hermitian. If A is Symmetric/Hermitian, it is assumed that the outcome of the operation \( x y^T \) is also Symmetric/Hermitian and only the corresponding part (upper/lower) will be calculated.

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe update coefficient.
[in]xThe input vector.
[in]yThe input vector.
[in,out]AThe matrix to be updated.
[in]cublasHandlerThe cuBLAS handler for GPU operations (defaults to global handler).

◆ outerc()

template<typename T_Scalar>
void culite::ops::outerc ( T_Scalar alpha,
const dns::XxVector< T_Scalar > & x,
const dns::XxVector< T_Scalar > & y,
dns::XxMatrix< T_Scalar > & A,
CuBlasHandler & cublasHandler = globalCuBlasHandler() )

Update a matrix with a conjugate vector outer product.

Performs the operation \( A = A + \alpha \cdot x y^H \). A can be General/Symmetric/Hermitian. If A is Symmetric/Hermitian, it is assumed that the outcome of the operation \( x y^H \) is also Symmetric/Hermitian and only the corresponding part (upper/lower) will be calculated.

Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe update coefficient.
[in]xThe input vector.
[in]yThe input vector.
[in,out]AThe matrix to be updated.
[in]cublasHandlerThe cuBLAS handler for GPU operations (defaults to global handler).