rocsparse_sgemmi Interface Reference

rocsparse_sgemmi Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_sgemmi Interface Reference
hipfort_rocsparse::rocsparse_sgemmi Interface Reference

Dense matrix sparse matrix multiplication using the CSR storage format. More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_sgemmi_ (handle, trans_a, trans_b, m, n, k, nnz, alpha, a, lda, descr, csr_val, csr_row_ptr, csr_col_ind, beta, c, ldc)
 
integer(kind(rocsparse_status_success)) function rocsparse_sgemmi_rank_0 (handle, trans_a, trans_b, m, n, k, nnz, alpha, a, lda, descr, csr_val, csr_row_ptr, csr_col_ind, beta, c, ldc)
 
integer(kind(rocsparse_status_success)) function rocsparse_sgemmi_rank_1 (handle, trans_a, trans_b, m, n, k, nnz, alpha, a, lda, descr, csr_val, csr_row_ptr, csr_col_ind, beta, c, ldc)
 
integer(kind(rocsparse_status_success)) function rocsparse_sgemmi_full_rank (handle, trans_a, trans_b, m, n, k, nnz, alpha, a, lda, descr, csr_val, csr_row_ptr, csr_col_ind, beta, c, ldc)
 

Detailed Description

Dense matrix sparse matrix multiplication using the CSR storage format.

rocsparse_gemmi multiplies the scalar \(\alpha\) with a column-oriented dense \(m \times k\) matrix \(op(A)\) and the sparse \(k \times n\) matrix \(op(B)\), defined in CSR storage format, 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 trans_A == rocsparse_operation_none} \\% A^T, & \text{if trans_A == rocsparse_operation_transpose} \\% A^H, & \text{if trans_A == rocsparse_operation_conjugate_transpose} \end{array} \right. \]

and

\[ op(B) = \left\{ \begin{array}{ll} B, & \text{if trans_B == rocsparse_operation_none} \\% B^T, & \text{if trans_B == rocsparse_operation_transpose} \\% B^H, & \text{if trans_B == rocsparse_operation_conjugate_transpose} \end{array} \right. \]

Note
Currently, only trans_A == rocsparse_operation_none is supported.
Currently, only trans_B == rocsparse_operation_transpose is supported.
This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
This routine supports execution in a hipGraph context.
Parameters
[in]handle- handle to the rocSPARSE library context queue.
[in]trans_A- matrix \(A\) operation type.
[in]trans_B- matrix \(B\) operation type.
[in]m- number of rows of the column-oriented dense matrix \(A\).
[in]n- number of columns of the sparse CSR matrix \(op(B)\) and \(C\).
[in]k- number of columns of the column-oriented dense matrix \(A\).
[in]nnz- number of non-zero entries of the sparse CSR matrix \(B\).
[in]alpha- scalar \(\alpha\).
[in]A- array of dimension \(lda \times k\) ( \(op(A) == A\)) or \(lda \times m\) ( \(op(A) == A^T\) or \(op(A) == A^H\)).
[in]lda- leading dimension of \(A\), must be at least \(m\) ( \(op(A) == A\)) or \(k\) ( \(op(A) == A^T\) or \(op(A) == A^H\)).
[in]descr- descriptor of the sparse CSR matrix \(B\). Currently, only rocsparse_matrix_type_general is supported.
[in]csr_val- array of nnz elements of the sparse CSR matrix \(B\).
[in]csr_row_ptr- array of m+1 elements that point to the start of every row of the sparse CSR matrix \(B\).
[in]csr_col_ind- array of nnz elements containing the column indices of the sparse CSR matrix \(B\).
[in]beta- scalar \(\beta\).
[in,out]C- column-oriented dense matrix of dimension \(ldc \times n\) that holds the values of \(C\).
[in]ldc- leading dimension of \(C\), must be at least \(m\).
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_sizem, n, k, nnz, lda, or ldc is invalid.
rocsparse_status_invalid_pointeralpha, A, csr_val, csr_row_ptr, csr_col_ind, beta, or C pointer is invalid.
Example
This example multiplies a column-oriented dense matrix with a CSC matrix.

Member Function/Subroutine Documentation

◆ rocsparse_sgemmi_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemmi::rocsparse_sgemmi_ ( type(c_ptr), value  handle,
integer(kind(rocsparse_operation_none)), value  trans_a,
integer(kind(rocsparse_operation_none)), value  trans_b,
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  a,
integer(c_int), value  lda,
type(c_ptr), value  descr,
type(c_ptr), value  csr_val,
type(c_ptr), value  csr_row_ptr,
type(c_ptr), value  csr_col_ind,
real(c_float)  beta,
type(c_ptr), value  c,
integer(c_int), value  ldc 
)

◆ rocsparse_sgemmi_full_rank()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemmi::rocsparse_sgemmi_full_rank ( type(c_ptr)  handle,
integer(kind(rocsparse_operation_none))  trans_a,
integer(kind(rocsparse_operation_none))  trans_b,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  k,
integer(c_int)  nnz,
real(c_float)  alpha,
real(c_float), dimension(:,:), target  a,
integer(c_int)  lda,
type(c_ptr)  descr,
real(c_float), dimension(:), target  csr_val,
integer(c_int), dimension(:), target  csr_row_ptr,
integer(c_int), dimension(:), target  csr_col_ind,
real(c_float)  beta,
real(c_float), dimension(:,:), target  c,
integer(c_int)  ldc 
)

◆ rocsparse_sgemmi_rank_0()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemmi::rocsparse_sgemmi_rank_0 ( type(c_ptr)  handle,
integer(kind(rocsparse_operation_none))  trans_a,
integer(kind(rocsparse_operation_none))  trans_b,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  k,
integer(c_int)  nnz,
real(c_float)  alpha,
real(c_float), target  a,
integer(c_int)  lda,
type(c_ptr)  descr,
real(c_float), target  csr_val,
integer(c_int), target  csr_row_ptr,
integer(c_int), target  csr_col_ind,
real(c_float)  beta,
real(c_float), target  c,
integer(c_int)  ldc 
)

◆ rocsparse_sgemmi_rank_1()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgemmi::rocsparse_sgemmi_rank_1 ( type(c_ptr)  handle,
integer(kind(rocsparse_operation_none))  trans_a,
integer(kind(rocsparse_operation_none))  trans_b,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  k,
integer(c_int)  nnz,
real(c_float)  alpha,
real(c_float), dimension(:), target  a,
integer(c_int)  lda,
type(c_ptr)  descr,
real(c_float), dimension(:), target  csr_val,
integer(c_int), dimension(:), target  csr_row_ptr,
integer(c_int), dimension(:), target  csr_col_ind,
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: