rocsparse_sbsrxmv Interface Reference

rocsparse_sbsrxmv Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_sbsrxmv Interface Reference
hipfort_rocsparse::rocsparse_sbsrxmv Interface Reference

Sparse matrix vector multiplication with mask operation using the BSR storage format. More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_sbsrxmv_ (handle, dir, trans, size_of_mask, mb, nb, nnzb, alpha, descr, bsr_val, bsr_mask_ptr, bsr_row_ptr, bsr_end_ptr, bsr_col_ind, block_dim, x, beta, y)
 
integer(kind(rocsparse_status_success)) function rocsparse_sbsrxmv_rank_0 (handle, dir, trans, size_of_mask, mb, nb, nnzb, alpha, descr, bsr_val, bsr_mask_ptr, bsr_row_ptr, bsr_end_ptr, bsr_col_ind, block_dim, x, beta, y)
 
integer(kind(rocsparse_status_success)) function rocsparse_sbsrxmv_rank_1 (handle, dir, trans, size_of_mask, mb, nb, nnzb, alpha, descr, bsr_val, bsr_mask_ptr, bsr_row_ptr, bsr_end_ptr, bsr_col_ind, block_dim, x, beta, y)
 

Detailed Description

Sparse matrix vector multiplication with mask operation using the BSR storage format.

rocsparse_bsrxmv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) modified matrix, defined in BSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[ y := \left( \alpha \cdot op(A) \cdot x + \beta \cdot y \right)\left( \text{mask} \right), \]

with

\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if trans == rocsparse_operation_none} \end{array} \right. \]

and where \(m = mb \times block\_dim\) and \(n = nb \times block\_dim\).

The \(\text{mask}\) is defined as an array of block row indices. The input sparse matrix is defined with a modified BSR storage format where the beginning and the end of each row is defined with two arrays, bsr_row_ptr and bsr_end_ptr (both of size mb), rather the usual bsr_row_ptr of size mb+1.

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 == rocsparse_operation_none is supported. Currently, block_dim==1 is not supported.
This routine supports execution in a hipGraph context.
Parameters
[in]handle- handle to the rocSPARSE library context queue.
[in]dir- matrix storage of BSR blocks.
[in]trans- matrix operation type.
[in]size_of_mask- number of updated block rows of the array y.
[in]mb- number of block rows of the sparse BSR matrix.
[in]nb- number of block columns of the sparse BSR matrix.
[in]nnzb- number of non-zero blocks of the sparse BSR matrix.
[in]alpha- scalar \(\alpha\).
[in]descr- descriptor of the sparse BSR matrix. Currently, only rocsparse_matrix_type_general is supported.
[in]bsr_val- array of nnzb blocks of the sparse BSR matrix.
[in]bsr_mask_ptr- array of size_of_mask elements that give the indices of the updated block rows.
[in]bsr_row_ptr- array of mb elements that point to the start of every block row of the sparse BSR matrix.
[in]bsr_end_ptr- array of mb elements that point to the end of every block row of the sparse BSR matrix.
[in]bsr_col_ind- array of nnzb elements containing the block column indices of the sparse BSR matrix.
[in]block_dim- block dimension of the sparse BSR matrix.
[in]x- array of nb*block_dim elements ( \(op(A) = A\)) or mb*block_dim elements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
[in]beta- scalar \(\beta\).
[in,out]y- array of mb*block_dim elements ( \(op(A) = A\)) or nb*block_dim elements ( \(op(A) = A^T\) or \(op(A) = A^H\)).
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_sizemb, nb, nnzb, block_dim, or size_of_mask is invalid.
rocsparse_status_invalid_valuesize_of_mask is greater than mb.
rocsparse_status_invalid_pointerdescr, alpha, bsr_val, bsr_row_ind, bsr_col_ind, x, beta, or y pointer is invalid.
rocsparse_status_arch_mismatchthe device is not supported.
rocsparse_status_not_implementedblock_dim==1, trans != rocsparse_operation_none or rocsparse_matrix_type != rocsparse_matrix_type_general.

Member Function/Subroutine Documentation

◆ rocsparse_sbsrxmv_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrxmv::rocsparse_sbsrxmv_ ( type(c_ptr), value  handle,
integer(kind(rocsparse_direction_row)), value  dir,
integer(kind(rocsparse_operation_none)), value  trans,
integer(c_int), value  size_of_mask,
integer(c_int), value  mb,
integer(c_int), value  nb,
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_mask_ptr,
type(c_ptr), value  bsr_row_ptr,
type(c_ptr), value  bsr_end_ptr,
type(c_ptr), value  bsr_col_ind,
integer(c_int), value  block_dim,
type(c_ptr), value  x,
real(c_float)  beta,
type(c_ptr), value  y 
)

◆ rocsparse_sbsrxmv_rank_0()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrxmv::rocsparse_sbsrxmv_rank_0 ( type(c_ptr)  handle,
integer(kind(rocsparse_direction_row))  dir,
integer(kind(rocsparse_operation_none))  trans,
integer(c_int)  size_of_mask,
integer(c_int)  mb,
integer(c_int)  nb,
integer(c_int)  nnzb,
real(c_float)  alpha,
type(c_ptr)  descr,
real(c_float), target  bsr_val,
integer(c_int), target  bsr_mask_ptr,
integer(c_int), target  bsr_row_ptr,
integer(c_int), target  bsr_end_ptr,
integer(c_int), target  bsr_col_ind,
integer(c_int)  block_dim,
real(c_float), target  x,
real(c_float)  beta,
real(c_float), target  y 
)

◆ rocsparse_sbsrxmv_rank_1()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sbsrxmv::rocsparse_sbsrxmv_rank_1 ( type(c_ptr)  handle,
integer(kind(rocsparse_direction_row))  dir,
integer(kind(rocsparse_operation_none))  trans,
integer(c_int)  size_of_mask,
integer(c_int)  mb,
integer(c_int)  nb,
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_mask_ptr,
integer(c_int), dimension(:), target  bsr_row_ptr,
integer(c_int), dimension(:), target  bsr_end_ptr,
integer(c_int), dimension(:), target  bsr_col_ind,
integer(c_int)  block_dim,
real(c_float), dimension(:), target  x,
real(c_float)  beta,
real(c_float), dimension(:), target  y 
)

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