hipsparsesgpsvinterleavedbatch Interface Reference

hipsparsesgpsvinterleavedbatch Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsesgpsvinterleavedbatch Interface Reference
hipfort_hipsparse::hipsparsesgpsvinterleavedbatch Interface Reference

Interleaved batch pentadiagonal solver. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsesgpsvinterleavedbatch_ (handle, algo, m, ds, dl, d, du, dw, x, batchcount, pbuffer)
 
integer(kind(hipsparse_status_success)) function hipsparsesgpsvinterleavedbatch_rank_0 (handle, algo, m, ds, dl, d, du, dw, x, batchcount, pbuffer)
 
integer(kind(hipsparse_status_success)) function hipsparsesgpsvinterleavedbatch_rank_1 (handle, algo, m, ds, dl, d, du, dw, x, batchcount, pbuffer)
 

Detailed Description

Interleaved batch pentadiagonal solver.

hipsparseXgpsvInterleavedBatch solves a batch of pentadiagonal linear systems

\[ P^{i}*x^{i} = x^{i} \]

where for each batch \(i=0\ldots\) batchCount, \(P^{i}\) is a sparse pentadiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the pentadiagonal matrices, \(P^{i}\), are packed in an interleaved fashion into five vectors: ds for the lowest diagonals, dl for the lower diagonals, d for the main diagonals, du for the upper diagonals, and dw for the highest digaonals. See below for a description of the interleaved memory pattern.

Solving the batched pentadiagonal system involves two steps. First, the user calls hipsparseSgpsvInterleavedBatch_bufferSizeExt "`hipsparseSgpsvInterleavedBatch_bufferSizeExt()`" to determine the size of the required temporary storage buffer. Once determined, the user allocates this buffer and passes it to hipsparseSgpsvInterleavedBatch "hipsparseXgpsvInterleavedBatch()" to perform the actual solve. The \(x^{i}\) vectors, which initially stores the right-hand side values, are overwritten with the solution after the call to hipsparseSgpsvInterleavedBatch "hipsparseXgpsvInterleavedBatch()".

Unlike the strided batch routines, which write each batch matrix one after the other in memory, the interleaved routines write the batch matrices such that each element from each matrix is written consecutively one after the other. For example, consider the following batch matrices:

\[ \begin{bmatrix} t^{0}_{00} & t^{0}_{01} & t^{0}_{02} \\% t^{0}_{10} & t^{0}_{11} & t^{0}_{12} \\% t^{0}_{20} & t^{0}_{21} & t^{0}_{22} \end{bmatrix} \begin{bmatrix} t^{1}_{00} & t^{1}_{01} & t^{1}_{02} \\% t^{1}_{10} & t^{1}_{11} & t^{1}_{12} \\% t^{1}_{20} & t^{1}_{21} & t^{1}_{22} \end{bmatrix} \begin{bmatrix} t^{2}_{00} & t^{2}_{01} & t^{2}_{02} \\% t^{2}_{10} & t^{2}_{11} & t^{2}_{12} \\% t^{2}_{20} & t^{2}_{21} & t^{2}_{22} \end{bmatrix} \]

In interleaved format, the highest, higher, lowest, lower, and diagonal arrays would look like:

\[ \begin{align} \text{lowest} &= \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & t^{0}_{20} & t^{1}_{20} & t^{2}_{20} \end{bmatrix} \\% \text{lower} &= \begin{bmatrix} 0 & 0 & 0 & t^{0}_{10} & t^{1}_{10} & t^{1}_{10} & t^{0}_{21} & t^{1}_{21} & t^{2}_{21} \end{bmatrix} \\% \text{diagonal} &= \begin{bmatrix} t^{0}_{00} & t^{1}_{00} & t^{2}_{00} & t^{0}_{11} & t^{1}_{11} & t^{2}_{11} & t^{0}_{22} & t^{1}_{22} & t^{2}_{22} \end{bmatrix} \\% \text{higher} &= \begin{bmatrix} t^{0}_{01} & t^{1}_{01} & t^{2}_{01} & t^{0}_{12} & t^{1}_{12} & t^{2}_{12} & 0 & 0 & 0 \end{bmatrix} \\% \text{highest} &= \begin{bmatrix} t^{0}_{02} & t^{1}_{02} & t^{2}_{02} & 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \\% \end{align} \]

For the lowest array, the first 2*batchCount entries are zero, and for the lower array, the first batchCount entries are zero. For the upper array, the last batchCount entries are zero, and for the highest array, the last 2*batchCount entries are zero.

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]algo- algorithm to solve the linear system.
[in]m- size of the pentadiagonal linear system.
[in,out]ds- lower diagonal (distance 2) of the pentadiagonal system. The first two entries must be zero.
[in,out]dl- lower diagonal of the pentadiagonal system. The first entry must be zero.
[in,out]d- main diagonal of the pentadiagonal system.
[in,out]du- upper diagonal of the pentadiagonal system. The last entry must be zero.
[in,out]dw- upper diagonal (distance 2) of the pentadiagonal system. The last two entries must be zero.
[in,out]x- Dense array of right-hand-sides with dimension batchCount by m.
[in]batchCount- The number of systems to solve.
[in]pBuffer- Temporary storage buffer allocated by the user.
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_INVALID_VALUEhandle, m, alg, batchCount, ds, dl, d, du, dw, x, or pBuffer pointer is invalid.
HIPSPARSE_STATUS_INTERNAL_ERRORan internal error occurred.

Member Function/Subroutine Documentation

◆ hipsparsesgpsvinterleavedbatch_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgpsvinterleavedbatch::hipsparsesgpsvinterleavedbatch_ ( type(c_ptr), value  handle,
integer(c_int), value  algo,
integer(c_int), value  m,
type(c_ptr), value  ds,
type(c_ptr), value  dl,
type(c_ptr), value  d,
type(c_ptr), value  du,
type(c_ptr), value  dw,
type(c_ptr), value  x,
integer(c_int), value  batchcount,
type(c_ptr), value  pbuffer 
)

◆ hipsparsesgpsvinterleavedbatch_rank_0()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgpsvinterleavedbatch::hipsparsesgpsvinterleavedbatch_rank_0 ( type(c_ptr)  handle,
integer(c_int)  algo,
integer(c_int)  m,
real(c_float), target  ds,
real(c_float), target  dl,
real(c_float), target  d,
real(c_float), target  du,
real(c_float), target  dw,
real(c_float), target  x,
integer(c_int)  batchcount,
type(c_ptr)  pbuffer 
)

◆ hipsparsesgpsvinterleavedbatch_rank_1()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgpsvinterleavedbatch::hipsparsesgpsvinterleavedbatch_rank_1 ( type(c_ptr)  handle,
integer(c_int)  algo,
integer(c_int)  m,
real(c_float), dimension(:), target  ds,
real(c_float), dimension(:), target  dl,
real(c_float), dimension(:), target  d,
real(c_float), dimension(:), target  du,
real(c_float), dimension(:), target  dw,
real(c_float), dimension(:), target  x,
integer(c_int)  batchcount,
type(c_ptr)  pbuffer 
)

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