-
aoclsparse_status aoclsparse_spmm(aoclsparse_operation opA, const aoclsparse_matrix A, const aoclsparse_matrix B, aoclsparse_matrix *C)#
Sparse matrix Sparse matrix multiplication for real and complex datatypes.
aoclsparse_?spmmmultiplies two sparse matrices in CSR storage format. The result is stored in a newly allocated sparse matrix in CSR format, such that\[\begin{split}C = op(A) \cdot B, \text{ with } op(A) = \left\{ \begin{array}{ll} A, & \text{ if } {\bf\mathsf{opA}} = \text{aoclsparse}\_\text{operation}\_\text{none} \\ A^T, & \text{ if } {\bf\mathsf{opA}} = \text{aoclsparse}\_\text{operation}\_\text{transpose} \\ A^H, & \text{ if } {\bf\mathsf{opA}} = \text{aoclsparse}\_\text{operation}\_\text{conjugate}\_\text{transpose} \end{array} \right.\end{split}\]where \(A\) is a \(m \times k\) matrix , \(B\) is a \(k \times n\) matrix, resulting in \(m \times n\) matrix \(C\), foropA= aoclsparse_operation_none. \(A\) is a \(k \times m\) matrix when opA = aoclsparse_operation_transpose or aoclsparse_operation_conjugate_transpose- Parameters:
opA – [in] matrix \(A\) operation type.
A – [in] sparse CSR matrix \(A\).
B – [in] sparse CSR matrix \(B\).
*C – [out] Pointer to sparse CSR matrix \(C\) . Matrix \(C\) arrays will always have zero-based indexing, irrespective of matrix \(A\) or matrix \(B\) being one-based or zero-based indexing. The column indices of the output matrix in CSR format can appear unsorted.
- Return values:
aoclsparse_status_success – the operation completed successfully.
aoclsparse_status_invalid_pointer –
A,B,Cis invalid.aoclsparse_status_invalid_size – input size parameters contain an invalid value.
aoclsparse_status_invalid_value – input parameters contain an invalid value.
aoclsparse_status_wrong_type –
AandBmatrix data types do not match.aoclsparse_status_memory_error – Memory allocation failure.
aoclsparse_status_not_implemented – Input matrices
AorBis not in CSR format