aoclsparse_?spmmd() - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
aoclsparse_status aoclsparse_sspmmd(const aoclsparse_operation op, const aoclsparse_matrix A, const aoclsparse_matrix B, const aoclsparse_order layout, float *C, const aoclsparse_int ldc)#
aoclsparse_status aoclsparse_dspmmd(const aoclsparse_operation op, const aoclsparse_matrix A, const aoclsparse_matrix B, const aoclsparse_order layout, double *C, const aoclsparse_int ldc)#
aoclsparse_status aoclsparse_cspmmd(const aoclsparse_operation op, const aoclsparse_matrix A, const aoclsparse_matrix B, const aoclsparse_order layout, aoclsparse_float_complex *C, const aoclsparse_int ldc)#
aoclsparse_status aoclsparse_zspmmd(const aoclsparse_operation op, const aoclsparse_matrix A, const aoclsparse_matrix B, const aoclsparse_order layout, aoclsparse_double_complex *C, const aoclsparse_int ldc)#

Matrix multiplication of two sparse matrices stored in the CSR storage format. The output matrix is stored in a dense format.

aoclsparse_?spmmd multiplies a sparse matrix \(A\) and a sparse matrix \(B\), both stored in the CSR storage format, and saves the result in a dense matrix \(C\), such that

\[ C := op(A) \cdot B, \]
with
\[\begin{split} op(A) = \left\{ \begin{array}{ll} A, & \text{if op} = \text{aoclsparse\_operation\_none} \\ A^T, & \text{if op} = \text{aoclsparse\_operation\_transpose} \\ A^H, & \text{if op} = \text{aoclsparse\_operation\_conjugate\_transpose} \end{array} \right. \end{split}\]
Parameters:
  • op[in] Operation to perform on matrix \(A\).

  • A[in] Matrix structure containing sparse matrix \(A\) of size \(m \times k\).

  • B[in] Matrix structure containing sparse matrix \(B\) of size \(k \times n\) if op is aoclsparse_operation_none otherwise of size \(m \times n\).

  • layout[in] Ordering of the dense output matrix: valid values are aoclsparse_order_row and aoclsparse_order_column.

  • C[inout] Dense output matrix \(C\) of size \(m \times n\) if op is aoclsparse_operation_none, otherwise of size \(k \times n\) containing the matrix-matrix product of \(A\) and \(B\).

  • ldc[in] Leading dimension of \(C\), e.g., for C stored in aoclsparse_order_row, ldc must be at least \(\max{(1, m)}\) when \(op(A) = A\), or \(\max{(1, k)}\) if \(op(A) = A^T\) or \(op(A) = A^H\).

Return values:
  • aoclsparse_status_success – The operation completed successfully.

  • aoclsparse_status_invalid_sizem, n, k, nnz or ldc is not valid.

  • aoclsparse_status_invalid_pointerA, B or C pointer is not valid.

  • aoclsparse_status_wrong_typeaoclsparse_matrix_data_type does not match the precision type.

  • aoclsparse_status_not_implemented – aoclsparse_matrix_format_type is not aoclsparse_csr_mat.