mkl_sparse_sp2m
mkl_sparse_sp2m
Computes the product of two sparse matrices. The result is stored in a newly allocated sparse matrix.
Syntax
sparse_status_t mkl_sparse_sp2m
(
const sparse_operation_t
transA
,
const struct
matrix_descr
descrA
,
const
sparse_matrix_t
A
,
const sparse_operation_t
transB
,
const struct
matrix_descr
descrB
,
const
sparse_matrix_t
B
,
const sparse_request_t
request
,
sparse_matrix_t
*C
);
Include Files
- mkl_spblas.h
Description
The
mkl_sparse_sp2m
routine performs a matrix-matrix operation:C := opA(A) *opB(B)
where
A
,B
, and C
are sparse matrices, opA
and opB
are matrix modifiers for matrices A
and B
, respectively.Input Parameters
- opA
- Specifies operation on input matrix.SPARSE_OPERATION_NON_TRANSPOSENon-transpose, op(A)=ASPARSE_OPERATION_TRANSPOSETranspose, op(A)=ATSPARSE_OPERATION_CONJUGATE_TRANSPOSEConjugate transpose, op(A)=AH
- opB
- Specifies operation on input matrix.SPARSE_OPERATION_NON_TRANSPOSENon-transpose, op(B)=BSPARSE_OPERATION_TRANSPOSETranspose, op(B)=BTSPARSE_OPERATION_CONJUGATE_TRANSPOSEConjugate transpose, op(B)=BH
- descrA
- Structure that specifies sparse matrix properties.Currently, only SPARSE_MATRIX_TYPE_GENERAL is supported.sparse_matrix_type_ttypespecifies the type of sparse matrix.SPARSE_MATRIX_TYPE_GENERALThe matrix is processed as is.SPARSE_MATRIX_TYPE_SYMMETRICThe matrix is symmetric (only the requested triangle is processed).SPARSE_MATRIX_TYPE_HERMITIANThe matrix is Hermitian (only the requested triangle is processed).SPARSE_MATRIX_TYPE_TRIANGULARThe matrix is triangular (only the requested triangle is processed).SPARSE_MATRIX_TYPE_DIAGONALThe matrix is diagonal (only diagonal elements are processed).SPARSE_MATRIX_TYPE_BLOCK_TRIANGULARThe matrix is block-triangular (only the requested triangle is processed). This applies to BSR format only.SPARSE_MATRIX_TYPE_BLOCK_DIAGONALThe matrix is block-diagonal (only the requested triangle is processed). This applies to BSR format only.sparse_fill_mode_tmodespecifies the triangular matrix portion for symmetric, Hermitian, triangular, and block-triangular matrices.SPARSE_FILL_MODE_LOWERThe lower triangular matrix is processed.SPARSE_FILL_MODE_UPPERThe upper triangular matrix is processed.sparse_diag_type_tdiagspecifies the type of diagonal for non-general matrices.SPARSE_DIAG_NON_UNITDiagonal elements must not be equal to 1.SPARSE_DIAG_UNITDiagonal elements are equal to 1.
- descrB
- Structure that specifies sparse matrix properties.Currently, only SPARSE_MATRIX_TYPE_GENERAL is supported.sparse_matrix_type_ttypespecifies the type of sparse matrix.SPARSE_MATRIX_TYPE_GENERALThe matrix is processed as is.SPARSE_MATRIX_TYPE_SYMMETRICThe matrix is symmetric (only the requested triangle is processed).SPARSE_MATRIX_TYPE_HERMITIANThe matrix is Hermitian (only the requested triangle is processed).SPARSE_MATRIX_TYPE_TRIANGULARThe matrix is triangular (only the requested triangle is processed).SPARSE_MATRIX_TYPE_DIAGONALThe matrix is diagonal (only diagonal elements are processed).SPARSE_MATRIX_TYPE_BLOCK_TRIANGULARThe matrix is block-triangular (only the requested triangle is processed). This applies to BSR format only.SPARSE_MATRIX_TYPE_BLOCK_DIAGONALThe matrix is block-diagonal (only the requested triangle is processed). This applies to BSR format only.sparse_fill_mode_tmodespecifies the triangular matrix portion for symmetric, Hermitian, triangular, and block-triangular matrices.SPARSE_FILL_MODE_LOWERThe lower triangular matrix is processed.SPARSE_FILL_MODE_UPPERThe upper triangular matrix is processed.sparse_diag_type_tdiagspecifies the type of diagonal for non-general matrices.SPARSE_DIAG_NON_UNITDiagonal elements must not be equal to 1.SPARSE_DIAG_UNITDiagonal elements are equal to 1.
- A
- Handle which contains the sparse matrixA.
- B
- Handle which contains the sparse matrixB.
- request
- Specifies whether the full computations are performed at once or using the two-stage algorithm. See Two-stage Algorithm for Inspector-executor Sparse BLAS Routines.SPARSE_STAGE_NNZ_COUNTOnlyrowIndex(BSR/CSR format) orcolIndex(CSC format) array of the matrix is computed internally. The computation can be extracted to measure the memory required for full operation.SPARSE_STAGE_FINALIZE_MULT_NO_VALFinalize computations of the matrix structure (values will not be computed). Use only after the call with SPARSE_STAGE_NNZ_COUNT parameter.SPARSE_STAGE_FINALIZE_MULTFinalize computation. Can also be used when the matrix structure remains unchanged and only values of the resulting matrixCneed to be recomputed.SPARSE_STAGE_FULL_MULT_NO_VALPerform computations of the matrix structure.SPARSE_STAGE_FULL_MULTPerform the entire computation in a single step.
Output Parameters
- C
- Handle which contains the resulting sparse matrix.
Return Values
The function returns a value indicating whether the operation was successful, or the reason why it failed.
- SPARSE_STATUS_SUCCESS
- The operation was successful.
- SPARSE_STATUS_NOT_INITIALIZED
- The routine encountered an empty handle or matrix array.
- SPARSE_STATUS_ALLOC_FAILED
- The internal memory allocation failed.
- SPARSE_STATUS_INVALID_VALUE
- The input parameters contain an invalid value.
- SPARSE_STATUS_EXECUTION_FAILED
- The execution failed.
- SPARSE_STATUS_INTERNAL_ERROR
- An error occurred in the implementation of the algorithm.
- SPARSE_STATUS_NOT_SUPPORTED
- The requested operation is not supported.