cuLite v0.3.1
A lite CUDA C++ Interface
Loading...
Searching...
No Matches
Matrix-Matrix Operations

High-performance matrix multiplications (GEMM). More...

Functions

template<typename T_Scalar>
void culite::ops::mult (T_Scalar alpha, op_t opA, const dns::XxMatrix< T_Scalar > &A, op_t opB, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C, CuBlasHandler &cuBlasHandler=globalCuBlasHandler())
 Updates a general matrix with a matrix-matrix product.
template<typename T_Int, typename T_Scalar>
void culite::ops::mult (T_Scalar alpha, op_t opA, const csr::XxMatrix< T_Int, T_Scalar > &A, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C, CuSparseHandler &cuSparseHandler=globalCuSparseHandler())
 Updates a general dense matrix with a sparse-dense matrix-matrix product.
template<typename T_Int, typename T_Scalar>
void culite::ops::mult (T_Scalar alpha, op_t opA, const csc::XxMatrix< T_Int, T_Scalar > &A, const dns::XxMatrix< T_Scalar > &B, T_Scalar beta, dns::XxMatrix< T_Scalar > &C, CuSparseHandler &cuSparseHandler=globalCuSparseHandler())
 Updates a general dense matrix with a sparse-dense matrix-matrix product.

Detailed Description

High-performance matrix multiplications (GEMM).

Function Documentation

◆ mult() [1/3]

template<typename T_Scalar>
void culite::ops::mult ( T_Scalar alpha,
op_t opA,
const dns::XxMatrix< T_Scalar > & A,
op_t opB,
const dns::XxMatrix< T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C,
CuBlasHandler & cuBlasHandler = globalCuBlasHandler() )

Updates a general matrix with a matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot op_B(B) \). C can be General/Symmetric/Hermitian. If C is Symmetric/Hermitian, it is assumed that the outcome of the operation \( op_A(A) \cdot op_B(B) \) is also Symmetric/Hermitian and only the corresponding part (upper/lower) will be calculated. Valid combinations are the following:

A B opA opB C
General General unconstrained unconstrained General
Symmetric General N unconstrained General
Hermitian General N unconstrained General
General General N or T T or N Symmetric
General General N or C C or N Hermitian
Template Parameters
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input matrix.
[in]opBThe operation to be performed for matrix B.
[in]BThe input matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe matrix to be updated.
[in]cuBlasHandlerThe cuBLAS handler for GPU operations (defaults to global handler).
Examples
ex02m_dense_matrix_algebra_vmult.cpp, ex02n_dense_matrix_algebra_mmult.cpp, ex02o_dense_matrix_algebra_mtmult.cpp, ex06m_sparse_matrix_algebra_vmult.cpp, and ex06n_sparse_matrix_algebra_mmult.cpp.

◆ mult() [2/3]

template<typename T_Int, typename T_Scalar>
void culite::ops::mult ( T_Scalar alpha,
op_t opA,
const csr::XxMatrix< T_Int, T_Scalar > & A,
const dns::XxMatrix< T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C,
CuSparseHandler & cuSparseHandler = globalCuSparseHandler() )

Updates a general dense matrix with a sparse-dense matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot B \). Valid combinations are the following:

A B opA opB C
General General unconstrained N General
Symmetric General N N General
Hermitian General N N General
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]BThe input dense matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe dense matrix to be updated.
[in]cuSparseHandlerThe cuSPARSE handler for GPU operations (defaults to global handler).

◆ mult() [3/3]

template<typename T_Int, typename T_Scalar>
void culite::ops::mult ( T_Scalar alpha,
op_t opA,
const csc::XxMatrix< T_Int, T_Scalar > & A,
const dns::XxMatrix< T_Scalar > & B,
T_Scalar beta,
dns::XxMatrix< T_Scalar > & C,
CuSparseHandler & cuSparseHandler = globalCuSparseHandler() )

Updates a general dense matrix with a sparse-dense matrix-matrix product.

Performs the operation \( C = \beta \cdot C + \alpha \cdot op_A(A) \cdot B \). Valid combinations are the following:

A B opA opB C
General General unconstrained N General
Symmetric General N N General
Hermitian General N N General
Template Parameters
T_IntThe integer type for indexing.
T_ScalarThe scalar type (e.g., float, double, complex).
Parameters
[in]alphaThe scaling coefficient.
[in]opAThe operation to be performed for matrix A.
[in]AThe input sparse matrix.
[in]BThe input dense matrix.
[in]betaThe scaling coefficient for C.
[in,out]CThe dense matrix to be updated.
[in]cuSparseHandlerThe cuSPARSE handler for GPU operations (defaults to global handler).