hipsparsescsrmm2 Interface Reference

hipsparsescsrmm2 Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsescsrmm2 Interface Reference
hipfort_hipsparse::hipsparsescsrmm2 Interface Reference

Sparse matrix dense matrix multiplication using the CSR storage format. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsescsrmm2_ (handle, transa, transb, m, n, k, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, b, ldb, beta, c, ldc)
 
integer(kind(hipsparse_status_success)) function hipsparsescsrmm2_rank_0 (handle, transa, transb, m, n, k, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, b, ldb, beta, c, ldc)
 
integer(kind(hipsparse_status_success)) function hipsparsescsrmm2_rank_1 (handle, transa, transb, m, n, k, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, b, ldb, beta, c, ldc)
 
integer(kind(hipsparse_status_success)) function hipsparsescsrmm2_full_rank (handle, transa, transb, m, n, k, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, b, ldb, beta, c, ldc)
 

Detailed Description

Sparse matrix dense matrix multiplication using the CSR storage format.

hipsparseXcsrmm2 multiplies the scalar \(\alpha\) with a sparse \(m \times k\) matrix \(A\), defined in CSR storage format, and the column-oriented dense \(k \times n\) matrix \(B\) and adds the result to the column-oriented dense \(m \times n\) matrix \(C\) that is multiplied by the scalar \(\beta\), such that

\[ C := \alpha \cdot op(A) \cdot op(B) + \beta \cdot C, \]

with

\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\% A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\% A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \]

and

\[ op(B) = \left\{ \begin{array}{ll} B, & \text{if transB == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\% B^T, & \text{if transB == HIPSPARSE_OPERATION_TRANSPOSE} \\% B^H, & \text{if transB == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \]

for(i = 0; i < ldc; ++i)
{
for(j = 0; j < n; ++j)
{
C[i][j] = beta * C[i][j];
for(k = csrRowPtr[i]; k < csrRowPtr[i + 1]; ++k)
{
C[i][j] += alpha * csrVal[k] * B[csrColInd[k]][j];
}
}
}
Note
This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
Parameters
[in]handle- handle to the hipSPARSE library context queue.
[in]transA- matrix \(A\) operation type.
[in]transB- matrix \(B\) operation type.
[in]m- number of rows of the sparse CSR matrix \(A\).
[in]n- number of columns of the dense matrix \(op(B)\) and \(C\).
[in]k- number of columns of the sparse CSR matrix \(A\).
[in]nnz- number of non-zero entries of the sparse CSR matrix \(A\).
[in]alpha- scalar \(\alpha\).
[in]descrA- descriptor of the sparse CSR matrix \(A\). Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.
[in]csrSortedValA- array of nnz elements of the sparse CSR matrix \(A\).
[in]csrSortedRowPtrA- array of m+1 elements that point to the start of every row of the sparse CSR matrix \(A\).
[in]csrSortedColIndA- array of nnz elements containing the column indices of the sparse CSR matrix \(A\).
[in]B- array of dimension ldb*n ( \(op(B) == B\)), ldb*k otherwise.
[in]ldb- leading dimension of \(B\). Must be at least \(\max{(1, k)}\) ( \(op(B) == B\)), \(\max{(1, n)}\) otherwise.
[in]beta- scalar \(\beta\).
[in,out]C- array of dimension ldc*n.
[in]ldc- leading dimension of \(C\). Must be at least \(\max{(1, m)}\) ( \(op(A) == A\)), \(\max{(1, k)}\) otherwise.
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle, m, n, k, nnz, ldb, ldc, descrA, alpha, csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, B, beta, or C is invalid.
HIPSPARSE_STATUS_ARCH_MISMATCHthe device is not supported.
HIPSPARSE_STATUS_NOT_SUPPORTEDhipsparseMatrixType_t != HIPSPARSE_MATRIX_TYPE_GENERAL.

Member Function/Subroutine Documentation

◆ hipsparsescsrmm2_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmm2::hipsparsescsrmm2_ ( type(c_ptr), value  handle,
integer(kind(hipsparse_operation_non_transpose)), value  transa,
integer(kind(hipsparse_operation_non_transpose)), value  transb,
integer(c_int), value  m,
integer(c_int), value  n,
integer(c_int), value  k,
integer(c_int), value  nnz,
real(c_float)  alpha,
type(c_ptr), value  descra,
type(c_ptr), value  csrsortedvala,
type(c_ptr), value  csrsortedrowptra,
type(c_ptr), value  csrsortedcolinda,
type(c_ptr), value  b,
integer(c_int), value  ldb,
real(c_float)  beta,
type(c_ptr), value  c,
integer(c_int), value  ldc 
)

◆ hipsparsescsrmm2_full_rank()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmm2::hipsparsescsrmm2_full_rank ( type(c_ptr)  handle,
integer(kind(hipsparse_operation_non_transpose))  transa,
integer(kind(hipsparse_operation_non_transpose))  transb,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  k,
integer(c_int)  nnz,
real(c_float)  alpha,
type(c_ptr)  descra,
real(c_float), dimension(:), target  csrsortedvala,
integer(c_int), dimension(:), target  csrsortedrowptra,
integer(c_int), dimension(:), target  csrsortedcolinda,
real(c_float), dimension(:,:), target  b,
integer(c_int)  ldb,
real(c_float)  beta,
real(c_float), dimension(:,:), target  c,
integer(c_int)  ldc 
)

◆ hipsparsescsrmm2_rank_0()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmm2::hipsparsescsrmm2_rank_0 ( type(c_ptr)  handle,
integer(kind(hipsparse_operation_non_transpose))  transa,
integer(kind(hipsparse_operation_non_transpose))  transb,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  k,
integer(c_int)  nnz,
real(c_float)  alpha,
type(c_ptr)  descra,
real(c_float), target  csrsortedvala,
integer(c_int), target  csrsortedrowptra,
integer(c_int), target  csrsortedcolinda,
real(c_float), target  b,
integer(c_int)  ldb,
real(c_float)  beta,
real(c_float), target  c,
integer(c_int)  ldc 
)

◆ hipsparsescsrmm2_rank_1()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmm2::hipsparsescsrmm2_rank_1 ( type(c_ptr)  handle,
integer(kind(hipsparse_operation_non_transpose))  transa,
integer(kind(hipsparse_operation_non_transpose))  transb,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  k,
integer(c_int)  nnz,
real(c_float)  alpha,
type(c_ptr)  descra,
real(c_float), dimension(:), target  csrsortedvala,
integer(c_int), dimension(:), target  csrsortedrowptra,
integer(c_int), dimension(:), target  csrsortedcolinda,
real(c_float), dimension(:), target  b,
integer(c_int)  ldb,
real(c_float)  beta,
real(c_float), dimension(:), target  c,
integer(c_int)  ldc 
)

The documentation for this interface was generated from the following file: