rocsparse_sbsrmm Interface Reference

rocsparse_sbsrmm Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_sbsrmm Interface Reference
hipfort_rocsparse::rocsparse_sbsrmm Interface Reference

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

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_sbsrmm_ (handle, dir, trans_a, trans_b, mb, n, kb, nnzb, alpha, descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, b, ldb, beta, c, ldc)
 
integer(kind(rocsparse_status_success)) function rocsparse_sbsrmm_rank_0 (handle, dir, trans_a, trans_b, mb, n, kb, nnzb, alpha, descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, b, ldb, beta, c, ldc)
 
integer(kind(rocsparse_status_success)) function rocsparse_sbsrmm_rank_1 (handle, dir, trans_a, trans_b, mb, n, kb, nnzb, alpha, descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, b, ldb, beta, c, ldc)
 
integer(kind(rocsparse_status_success)) function rocsparse_sbsrmm_full_rank (handle, dir, trans_a, trans_b, mb, n, kb, nnzb, alpha, descr, bsr_val, bsr_row_ptr, bsr_col_ind, block_dim, b, ldb, beta, c, ldc)
 

Detailed Description

Sparse matrix dense matrix multiplication using the BSR storage format.

rocsparse_bsrmm multiplies the scalar \(\alpha\) with a sparse \(m \times k\) matrix \(A\), defined in BSR 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 trans_A == rocsparse_operation_none} \\% \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} \\% \end{array} \right. \]

and where \(k = block\_dim \times kb\) and \(m = block\_dim \times mb\).

Note
This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
Currently, only trans_A == rocsparse_operation_none is supported.
This routine supports execution in a hipGraph context.
Parameters
[in]handle- handle to the rocSPARSE library context queue.
[in]dir- the storage format of the blocks. Can be rocsparse_direction_row or rocsparse_direction_column.
[in]trans_A- matrix \(A\) operation type. Currently, only rocsparse_operation_none is supported.
[in]trans_B- matrix \(B\) operation type. Currently, only rocsparse_operation_none and rocsparse_operation_transpose are supported.
[in]mb- number of block rows of the sparse BSR matrix \(A\).
[in]n- number of columns of the column-oriented dense matrix \(op(B)\) and \(C\).
[in]kb- number of block columns of the sparse BSR matrix \(A\).
[in]nnzb- number of non-zero blocks of the sparse BSR matrix \(A\).
[in]alpha- scalar \(\alpha\).
[in]descr- descriptor of the sparse BSR matrix \(A\). Currently, only rocsparse_matrix_type_general is supported.
[in]bsr_val- array of nnzb*block_dim*block_dim elements of the sparse BSR matrix \(A\).
[in]bsr_row_ptr- array of mb+1 elements that point to the start of every block row of the sparse BSR matrix \(A\).
[in]bsr_col_ind- array of nnzb elements containing the block column indices of the sparse BSR matrix \(A\).
[in]block_dim- size of the blocks in the sparse BSR matrix.
[in]B- column-oriented dense matrix of dimension \(ldb \times n\) ( \(op(B) == B\)), \(ldb \times k\) otherwise.
[in]ldb- leading dimension of \(B\), must be at least \(\max{(1, k)}\) ( \( op(B) == B\)) where \(k = block\_dim \times kb\), \(\max{(1, n)}\) otherwise.
[in]beta- scalar \(\beta\).
[in,out]C- column-oriented dense matrix of dimension \(ldc \times n\).
[in]ldc- leading dimension of \(C\), must be at least \(\max{(1, m)}\) ( \( op(A) == A\)) where \(m = block\_dim \times mb\), \(\max{(1, k)}\) where \(k = block\_dim \times kb\) otherwise.
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_sizemb, n, kb, nnzb, ldb, or ldc is invalid.
rocsparse_status_invalid_pointerdescr, alpha, bsr_val, bsr_row_ptr, bsr_col_ind, B, beta, or C pointer is invalid.
rocsparse_status_arch_mismatchthe device is not supported.
rocsparse_status_not_implementedtrans_A != rocsparse_operation_none, trans_B == rocsparse_operation_conjugate_transpose, or rocsparse_matrix_type != rocsparse_matrix_type_general.
Example
This example multiplies a BSR matrix with a column-oriented dense matrix.

Member Function/Subroutine Documentation

◆ rocsparse_sbsrmm_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrmm::rocsparse_sbsrmm_ ( type(c_ptr), value  handle,
integer(kind(rocsparse_direction_row)), value  dir,
integer(kind(rocsparse_operation_none)), value  trans_a,
integer(kind(rocsparse_operation_none)), value  trans_b,
integer(c_int), value  mb,
integer(c_int), value  n,
integer(c_int), value  kb,
integer(c_int), value  nnzb,
real(c_float)  alpha,
type(c_ptr), value  descr,
type(c_ptr), value  bsr_val,
type(c_ptr), value  bsr_row_ptr,
type(c_ptr), value  bsr_col_ind,
integer(c_int), value  block_dim,
type(c_ptr), value  b,
integer(c_int), value  ldb,
real(c_float)  beta,
type(c_ptr), value  c,
integer(c_int), value  ldc 
)

◆ rocsparse_sbsrmm_full_rank()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrmm::rocsparse_sbsrmm_full_rank ( type(c_ptr)  handle,
integer(kind(rocsparse_direction_row))  dir,
integer(kind(rocsparse_operation_none))  trans_a,
integer(kind(rocsparse_operation_none))  trans_b,
integer(c_int)  mb,
integer(c_int)  n,
integer(c_int)  kb,
integer(c_int)  nnzb,
real(c_float)  alpha,
type(c_ptr)  descr,
real(c_float), dimension(:), target  bsr_val,
integer(c_int), dimension(:), target  bsr_row_ptr,
integer(c_int), dimension(:), target  bsr_col_ind,
integer(c_int)  block_dim,
real(c_float), dimension(:,:), target  b,
integer(c_int)  ldb,
real(c_float)  beta,
real(c_float), dimension(:,:), target  c,
integer(c_int)  ldc 
)

◆ rocsparse_sbsrmm_rank_0()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrmm::rocsparse_sbsrmm_rank_0 ( type(c_ptr)  handle,
integer(kind(rocsparse_direction_row))  dir,
integer(kind(rocsparse_operation_none))  trans_a,
integer(kind(rocsparse_operation_none))  trans_b,
integer(c_int)  mb,
integer(c_int)  n,
integer(c_int)  kb,
integer(c_int)  nnzb,
real(c_float)  alpha,
type(c_ptr)  descr,
real(c_float), target  bsr_val,
integer(c_int), target  bsr_row_ptr,
integer(c_int), target  bsr_col_ind,
integer(c_int)  block_dim,
real(c_float), target  b,
integer(c_int)  ldb,
real(c_float)  beta,
real(c_float), target  c,
integer(c_int)  ldc 
)

◆ rocsparse_sbsrmm_rank_1()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrmm::rocsparse_sbsrmm_rank_1 ( type(c_ptr)  handle,
integer(kind(rocsparse_direction_row))  dir,
integer(kind(rocsparse_operation_none))  trans_a,
integer(kind(rocsparse_operation_none))  trans_b,
integer(c_int)  mb,
integer(c_int)  n,
integer(c_int)  kb,
integer(c_int)  nnzb,
real(c_float)  alpha,
type(c_ptr)  descr,
real(c_float), dimension(:), target  bsr_val,
integer(c_int), dimension(:), target  bsr_row_ptr,
integer(c_int), dimension(:), target  bsr_col_ind,
integer(c_int)  block_dim,
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: