Intel® Math Kernel Library 2019 Developer Reference - C

mkl_sparse_sp2m

Computes the product of two sparse matrices and stores the result as a sparse matrix.

Syntax

sparse_status_t mkl_sparse_sp2m (sparse_operation_t transA,struct matrix_descr descrA,const sparse_matrix_t A,sparse_operation_t transB,struct matrix_descr descrB,const sparse_matrix_t B,sparse_request_t request,sparse_matrix_t *C);

Include Files

Description

The mkl_sparse_sp2m routine performs a matrix-matrix operation:

C := opA(A) *opB(B)

where A,B, and C are sparse matrices.

Input Parameters

opA

Specifies operation on input matrix.

SPARSE_OPERATION_NON_TRANSPOSE Non-transpose, op(A)=A
SPARSE_OPERATION_TRANSPOSE Transpose, op(A)=A
SPARSE_OPERATION_CONJUGATE_TRANSPOSE Conjugate transpose, op(A)=A
opB

Specifies operation on input matrix.

SPARSE_OPERATION_NON_TRANSPOSE Non-transpose, op(B)=B
SPARSE_OPERATION_TRANSPOSE Transpose, op(B)=B
SPARSE_OPERATION_CONJUGATE_TRANSPOSE Conjugate transpose, op(B)=B
descrA

Structure that specifies sparse matrix properties.

sparse_matrix_type_ttype specifies the type of sparse matrix.

SPARSE_MATRIX_TYPE_GENERAL

The matrix is processed as is.

SPARSE_MATRIX_TYPE_SYMMETRIC

The matrix is symmetric (only the requested triangle is processed).

SPARSE_MATRIX_TYPE_HERMITIAN

The matrix is Hermitian (only the requested triangle is processed).

SPARSE_MATRIX_TYPE_TRIANGULAR

The matrix is triangular (only the requested triangle is processed).

SPARSE_MATRIX_TYPE_DIAGONAL

The matrix is diagonal (only diagonal elements are processed).

SPARSE_MATRIX_TYPE_BLOCK_TRIANGULAR

The matrix is block-triangular (only the requested triangle is processed). This applies to BSR format only.

SPARSE_MATRIX_TYPE_BLOCK_DIAGONAL

The matrix is block-diagonal (only the requested triangle is processed). This applies to BSR format only.

sparse_fill_mode_tmode specifies the triangular matrix portion for symmetric, Hermitian, triangular, and block-triangular matrices.

SPARSE_FILL_MODE_LOWER

The lower triangular matrix is processed.

SPARSE_FILL_MODE_UPPER

The upper triangular matrix is processed.

sparse_diag_type_tdiag specifies the type of diagonal for non-general matrices.

SPARSE_DIAG_NON_UNIT

Diagonal elements must not be equal to 1.

SPARSE_DIAG_UNIT

Diagonal elements are equal to 1.

descrB

Structure that specifies sparse matrix properties.

sparse_matrix_type_ttype specifies the type of sparse matrix.

SPARSE_MATRIX_TYPE_GENERAL

The matrix is processed as is.

SPARSE_MATRIX_TYPE_SYMMETRIC

The matrix is symmetric (only the requested triangle is processed).

SPARSE_MATRIX_TYPE_HERMITIAN

The matrix is Hermitian (only the requested triangle is processed).

SPARSE_MATRIX_TYPE_TRIANGULAR

The matrix is triangular (only the requested triangle is processed).

SPARSE_MATRIX_TYPE_DIAGONAL

The matrix is diagonal (only diagonal elements are processed).

SPARSE_MATRIX_TYPE_BLOCK_TRIANGULAR

The matrix is block-triangular (only the requested triangle is processed). This applies to BSR format only.

SPARSE_MATRIX_TYPE_BLOCK_DIAGONAL

The matrix is block-diagonal (only the requested triangle is processed). This applies to BSR format only.

sparse_fill_mode_tmode specifies the triangular matrix portion for symmetric, Hermitian, triangular, and block-triangular matrices.

SPARSE_FILL_MODE_LOWER

The lower triangular matrix is processed.

SPARSE_FILL_MODE_UPPER

The upper triangular matrix is processed.

sparse_diag_type_tdiag specifies the type of diagonal for non-general matrices.

SPARSE_DIAG_NON_UNIT

Diagonal elements must not be equal to 1.

SPARSE_DIAG_UNIT

Diagonal elements are equal to 1.

A

Handle containing sparse matrix in internal data structure.

B

Handle containing sparse matrix in internal data structure.

sparse_request_t

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_COUNT

Only rowIndex (BSR/CSR format) or colIndex (CSC format) array of the matrix is computed internally. It can be extracted to measure the memory required for full operation.

SPARSE_STAGE_FINALIZE_MULT

Finalize computation. Used after calling with SPARSE_STAGE_NNZ_COUNT.

SPARSE_STAGE_FULL_MULT

Perform the entire computation in a single step.

Output Parameters

C

Handle containing the resulting sparse matrix in internal data structure.

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.