hipsparsesgebsr2gebsc Interface Reference

hipsparsesgebsr2gebsc Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsesgebsr2gebsc Interface Reference
hipfort_hipsparse::hipsparsesgebsr2gebsc Interface Reference

Convert a sparse GEBSR matrix into a sparse GEBSC matrix. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsesgebsr2gebsc_ (handle, mb, nb, nnzb, bsrval, bsrrowptr, bsrcolind, rowblockdim, colblockdim, bscval, bscrowind, bsccolptr, copyvalues, idxbase, temp_buffer)
 

Detailed Description

Convert a sparse GEBSR matrix into a sparse GEBSC matrix.

hipsparseXgebsr2gebsc converts a GEBSR matrix into a GEBSC matrix. hipsparseXgebsr2gebsc can also be used to convert a GEBSC matrix into a GEBSR matrix. copyValues decides whether bscVal is being filled during conversion (HIPSPARSE_ACTION_NUMERIC) or not (HIPSPARSE_ACTION_SYMBOLIC).

hipsparseXgebsr2gebsc requires extra temporary storage buffer that has to be allocated by the user. Storage buffer size can be determined by hipsparseSgebsr2gebsc_bufferSize "hipsparseXgebsr2gebsc_bufferSize()".

For example, given the GEBSR matrix:

\[ \left[ \begin{array}{c | c} \begin{array}{c c} 1 & 2 \\% 3 & 4 \\% 6 & 0 \end{array} & \begin{array}{c c} 0 & 2 \\% 0 & 0 \\% 3 & 4 \end{array} \\% \hline \begin{array}{c c} 5 & 0 \\% 1 & 2 \\% 3 & 4 \end{array} & \begin{array}{c c} 6 & 7 \\% 3 & 4 \\% 3 & 4 \end{array} \\% \end{array} \right] \]

represented with the arrays:

\[ \begin{align} \text{bsrRowPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\% \text{bsrColInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\% \text{bsrVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 0 & 2 & 0 & 0 & 3 & 4 & 5 & 0 & 1 & 2 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align} \]

this function converts the matrix to GEBSC format:

\[ \begin{align} \text{bscRowInd} &= \begin{bmatrix} 0 & 1 & 0 & 1 \end{bmatrix} \\% \text{bscColPtr} &= \begin{bmatrix} 0 & 2 & 4 \end{bmatrix} \\% \text{bscVal} &= \begin{bmatrix} 1 & 2 & 3 & 4 & 6 & 0 & 5 & 0 & 1 & 2 & 3 & 4 & 0 & 2 & 0 & 0 & 3 & 4 & 6 & 7 & 3 & 4 & 3 & 4 \end{bmatrix} \end{align} \]

The GEBSC arrays bscRowInd, bscColPtr, and bscVal must be allocated by the user prior to calling hipsparseXgebsr2gebsc(). The bscRowInd array has size nnzb, the bscColPtr array has size nb+1, and the bscVal array has size nnzb*rowBlockDim*colBlockDim.

Note
The resulting matrix can also be seen as the transpose of the input matrix.
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]mb- number of rows of the sparse general BSR matrix.
[in]nb- number of columns of the sparse general BSR matrix.
[in]nnzb- number of non-zero entries of the sparse general BSR matrix.
[in]bsrVal- array of nnzb * rowBlockDim * colBlockDim elements of the sparse general BSR matrix.
[in]bsrRowPtr- array of m+1 elements that point to the start of every row of the sparse general BSR matrix.
[in]bsrColInd- array of nnz elements containing the column indices of the sparse general BSR matrix.
[in]rowBlockDim- row size of the blocks in the sparse general BSR matrix.
[in]colBlockDim- col size of the blocks in the sparse general BSR matrix.
[out]bscVal- array of nnz elements of the sparse BSC matrix.
[out]bscRowInd- array of nnz elements containing the row indices of the sparse BSC matrix.
[out]bscColPtr- array of n+1 elements that point to the start of every column of the sparse BSC matrix.
[in]copyValues- HIPSPARSE_ACTION_SYMBOLIC or HIPSPARSE_ACTION_NUMERIC.
[in]idxBase- HIPSPARSE_INDEX_BASE_ZERO or HIPSPARSE_INDEX_BASE_ONE.
[in]temp_buffer- temporary storage buffer allocated by the user. The size is returned by hipsparseSgebsr2gebsc_bufferSize "hipsparseXgebsr2gebsc_bufferSize()".
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle, mb, nb, nnzb, bsrVal, bsrRowPtr, bsrColInd, bscVal, bscRowInd, bscColPtr, or temp_buffer pointer is invalid.
HIPSPARSE_STATUS_ARCH_MISMATCHthe device is not supported.
HIPSPARSE_STATUS_INTERNAL_ERRORan internal error occurred.

Member Function/Subroutine Documentation

◆ hipsparsesgebsr2gebsc_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgebsr2gebsc::hipsparsesgebsr2gebsc_ ( type(c_ptr), value  handle,
integer(c_int), value  mb,
integer(c_int), value  nb,
integer(c_int), value  nnzb,
type(c_ptr), value  bsrval,
type(c_ptr), value  bsrrowptr,
type(c_ptr), value  bsrcolind,
integer(c_int), value  rowblockdim,
integer(c_int), value  colblockdim,
type(c_ptr), value  bscval,
type(c_ptr), value  bscrowind,
type(c_ptr), value  bsccolptr,
integer(kind(hipsparse_action_symbolic)), value  copyvalues,
integer(kind(hipsparse_index_base_zero)), value  idxbase,
type(c_ptr), value  temp_buffer 
)

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