Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
mkl_sparse_sp2m
Computes the product of two sparse matrices. The result is stored in a newly allocated sparse matrix.
Syntax
stat = mkl_sparse_sp2m ( opA, descrA, A, opB, descrB, B, request, C )
Include Files
mkl_spblas.f90
Description
The mkl_sparse_sp2m routine performs a matrix-matrix operation:
\[C \leftarrow opA(A)\cdot 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
C_INT.
Specifies operation on input matrix \(A\).
opA |
Description |
|---|---|
SPARSE_OPERATION_NON_TRANSPOSE |
\(opA(A) = A\) |
SPARSE_OPERATION_TRANSPOSE |
\(opA(A) = A^{T}\) |
SPARSE_OPERATION_CONJUGATE_TRANSPOSE |
\(opA(A) = A^{H}\) |
opB
C_INT.
Specifies operation on input matrix \(B\).
opB |
Description |
|---|---|
SPARSE_OPERATION_NON_TRANSPOSE |
\(opB(B) = B\) |
SPARSE_OPERATION_TRANSPOSE |
\(opB(B) = B^{T}\) |
SPARSE_OPERATION_CONJUGATE_TRANSPOSE |
\(opB(B) = B^{H}\) |
descrA
MATRIX_DESCR .
Descriptor specifying sparse matrix properties.
sparse_matrix_type_t type |
Specifies the type of a sparse matrix:
|
sparse_fill_mode_t mode |
Specifies the triangular matrix part for symmetric, Hermitian, triangular, and block-triangular matrices:
|
sparse_diag_type_t diag |
Specifies diagonal type for non-general matrices:
|
- descrB
-
MATRIX_DESCR .
Descriptor specifying sparse matrix properties.
sparse_matrix_type_t type
Specifies the type of a 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 requested triangle is processed). Applies to BSR format only.
SPARSE_MATRIX_TYPE_BLOCK_DIAGONAL - The matrix is block-diagonal (only requested diagonal blocks are processed). Applies to BSR format only.
sparse_fill_mode_t mode
Specifies the triangular matrix part for symmetric, Hermitian, triangular, and block-triangular matrices:
SPARSE_FILL_MODE_LOWER - The lower triangular matrix part is processed.
SPARSE_FILL_MODE_UPPER - The upper triangular matrix part is processed.
sparse_diag_type_t diag
Specifies diagonal type for non-general matrices:
SPARSE_DIAG_NON_UNIT - Diagonal elements might not be equal to one.
SPARSE_DIAG_UNIT - Diagonal elements are equal to one.
A
SPARSE_MATRIX_T.
Handle which contains the sparse matrix \(A\) .
B
SPARSE_MATRIX_T.
Handle which contains the sparse matrix \(B\) .
request
C_INT.
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_REQUEST_T parameter |
Description |
|---|---|
SPARSE_STAGE_NNZ_COUNT |
Only rowIndex (BSR/CSR format) or colIndex (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_VAL |
Finalize computations of the matrix structure (values will not be computed). Use only after the call with SPARSE_STAGE_NNZ_COUNT` parameter. |
SPARSE_STAGE_FINALIZE_MULT |
Finalize computation. Can also be used when the matrix structure remains unchanged and only values of the resulting matrix \(C\) need to be recomputed. |
SPARSE_STAGE_FULL_MULT_NO_VAL |
Perform computations of the matrix structure. |
SPARSE_STAGE_FULL_MULT |
Perform the entire computation in a single step. |
Output Parameters
C
SPARSE_MATRIX_T.
Handle which contains the resulting sparse matrix.
stat
INTEGER
Value indicating whether the operation was successful, and if not, why:
SPARSE_STATUS_SUCCESS |
The operation was successful. |
SPARSE_STATUS_NOT_INITIALIZED |
The routine encountered an empty handle or matrix array. |
SPARSE_STATUS_ALLOC_FAILED |
Internal memory allocation failed. |
SPARSE_STATUS_INVALID_VALUE |
The input parameters contain an invalid value. |
SPARSE_STATUS_EXECUTION_FAILED |
Execution failed. |
SPARSE_STATUS_INTERNAL_ERROR |
An error in algorithm implementation occurred. |
SPARSE_STATUS_NOT_SUPPORTED |
The requested operation is not supported. |
Return Values
See Output Parameter stat.