spmm_csr Interface

public interface spmm_csr

Performs the Compressed Sparse Row (CSR) matrix-matrix operations

C := op(A)B (sparse B and C) C := alphaop(A)B + betaC (dense B and C)

with op(A) = A or A^T.


Module Procedures

private recursive subroutine spspmm_csr(trans, request, sort, m, n, k, a, ja, ia, b, jb, ib, c, jc, ic, nzmax, info)

Multiply two CSR matrices, C := op(A)*B, with a CSR result. The columns of each row of C are returned in ascending order.

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: trans

Operation selector, ‘N’ for AB, ‘T’ or ‘C’ for A^TB

integer, intent(in) :: request

Computation stage, 0 computes ic, jc and c within nzmax elements, 1 computes only ic, 2 computes jc and c from an ic of a previous call

integer, intent(in) :: sort

Reordering selector, accepted for compatibility only since the inputs need no sorting and the result is always sorted

integer, intent(in) :: m

Number of rows of the matrix A

integer, intent(in) :: n

Number of columns of the matrix A

integer, intent(in) :: k

Number of columns of the matrix B

real(kind=wp), intent(in) :: a(:)

Non-zero elements of the matrix A

integer, intent(in) :: ja(:)

Column indices of the non-zero elements of A

integer(kind=i8), intent(in) :: ia(:)

Row offsets of A into a and ja, size m + 1

real(kind=wp), intent(in) :: b(:)

Non-zero elements of the matrix B

integer, intent(in) :: jb(:)

Column indices of the non-zero elements of B

integer(kind=i8), intent(in) :: ib(:)

Row offsets of B into b and jb, size n + 1 for ‘N’ and m + 1 for ‘T’

real(kind=wp), intent(inout) :: c(:)

Non-zero elements of the matrix C, not referenced for request 1

integer, intent(inout) :: jc(:)

Column indices of the non-zero elements of C, not referenced for request 1

integer(kind=i8), intent(inout) :: ic(:)

Row offsets of C into c and jc, size m + 1 for ‘N’ and n + 1 for ‘T’

integer(kind=i8), intent(in) :: nzmax

Maximum number of non-zero elements of C, only referenced for request 0

integer, intent(out) :: info

Exit status, zero on success, or the row of C exceeding nzmax for request 0

private subroutine spgemm_csr(transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, beta, c, ldc)

Multiply a CSR matrix by a dense matrix, C := alphaop(A)B + beta*C.

Arguments

Type IntentOptional Attributes Name
character(len=1), intent(in) :: transa

Operation selector, ‘N’ for AB, ‘T’ or ‘C’ for A^TB

integer, intent(in) :: m

Number of rows of the matrix A

integer, intent(in) :: n

Number of columns of the matrices B and C

integer, intent(in) :: k

Number of columns of the matrix A

real(kind=wp), intent(in) :: alpha

Matrix scaling factor

character(len=*), intent(in) :: matdescra

Matrix descriptor, structure in the first and triangle in the second character, the triangle is only referenced for symmetric matrices

real(kind=wp), intent(in) :: val(:)

Non-zero elements of the matrix A

integer, intent(in) :: indx(:)

Column indices of the non-zero elements of A

integer(kind=i8), intent(in) :: pntrb(:)

Offsets of the first element of each row of A, size m

integer(kind=i8), intent(in) :: pntre(:)

Offsets past the last element of each row of A, size m

real(kind=wp), intent(in) :: b(ldb,n)

Dense right-hand side block, k-by-n for ‘N’ and m-by-n for ‘T’

integer, intent(in) :: ldb

Leading dimension of B

real(kind=wp), intent(in) :: beta

Existing-matrix scaling factor

real(kind=wp), intent(inout) :: c(ldc,n)

Dense product block, m-by-n for ‘N’ and k-by-n for ‘T’

integer, intent(in) :: ldc

Leading dimension of C