rocsparse_sgtsv_no_pivot_strided_batch Interface Reference

rocsparse_sgtsv_no_pivot_strided_batch Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_sgtsv_no_pivot_strided_batch Interface Reference
hipfort_rocsparse::rocsparse_sgtsv_no_pivot_strided_batch Interface Reference

Strided Batch tridiagonal solver (no pivoting) More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_sgtsv_no_pivot_strided_batch_ (handle, m, dl, d, du, x, batch_count, batch_stride, temp_buffer)
 
integer(kind(rocsparse_status_success)) function rocsparse_sgtsv_no_pivot_strided_batch_rank_0 (handle, m, dl, d, du, x, batch_count, batch_stride, temp_buffer)
 
integer(kind(rocsparse_status_success)) function rocsparse_sgtsv_no_pivot_strided_batch_rank_1 (handle, m, dl, d, du, x, batch_count, batch_stride, temp_buffer)
 

Detailed Description

Strided Batch tridiagonal solver (no pivoting)

rocsparse_gtsv_no_pivot_strided_batch solves a batched tridiagonal linear system

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

where for each batch \(i=0\ldots\) batch_count, \(T^{i}\) is a sparse tridiagonal matrix and \(x^{i}\) is a dense right-hand side vector. All of the tridiagonal matrices, \(T^{i}\), are packed one after the other into three vectors: dl for the lower diagonals, d for the main diagonals, and du for the upper diagonals. See below for a description of what this strided memory pattern looks like.

Solving the batched tridiagonal system involves two steps. First, call rocsparse_Xgtsv_no_pivot_strided_batch_buffer_size() to determine the size of the required temporary storage buffer. After this is determined, allocate the buffer and pass it to rocsparse_Xgtsv_no_pivot_strided_batch() 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 rocsparse_Xgtsv_no_pivot_strided_batch().

The strided batch routines write each batch matrix one after the other in memory. For example, consider the following batch matrices:

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

In strided format, the upper, lower, and diagonal arrays would look like:

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

For the lower array, for each batch i, the i*batch_stride entries are zero, and for the upper array, the i*batch_stride+batch_stride-1 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.
This routine supports execution in a hipGraph context.
Parameters
[in]handle- handle to the rocSPARSE library context queue.
[in]m- size of the tri-diagonal linear system (must be >= 2).
[in]dl- lower diagonal of tri-diagonal system. The first entry must be zero.
[in]d- main diagonal of tri-diagonal system.
[in]du- upper diagonal of tri-diagonal system. The last entry must be zero.
[in,out]x- dense array of righthand-sides, where the ith right-hand side starts at x+batch_stride*i.
[in]batch_count- the number of systems to solve.
[in]batch_stride- the number of elements that separate each system. Must satisfy batch_stride >= m.
[in]temp_buffer- temporary storage buffer allocated by the user.
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_sizem, batch_count, or batch_stride is invalid.
rocsparse_status_invalid_pointerdl, d, du, x, or temp_buffer pointer is invalid.
rocsparse_status_internal_erroran internal error occurred.
Example

Member Function/Subroutine Documentation

◆ rocsparse_sgtsv_no_pivot_strided_batch_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgtsv_no_pivot_strided_batch::rocsparse_sgtsv_no_pivot_strided_batch_ ( type(c_ptr), value  handle,
integer(c_int), value  m,
type(c_ptr), value  dl,
type(c_ptr), value  d,
type(c_ptr), value  du,
type(c_ptr), value  x,
integer(c_int), value  batch_count,
integer(c_int), value  batch_stride,
type(c_ptr), value  temp_buffer 
)

◆ rocsparse_sgtsv_no_pivot_strided_batch_rank_0()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgtsv_no_pivot_strided_batch::rocsparse_sgtsv_no_pivot_strided_batch_rank_0 ( type(c_ptr)  handle,
integer(c_int)  m,
real(c_float), target  dl,
real(c_float), target  d,
real(c_float), target  du,
real(c_float), target  x,
integer(c_int)  batch_count,
integer(c_int)  batch_stride,
type(c_ptr)  temp_buffer 
)

◆ rocsparse_sgtsv_no_pivot_strided_batch_rank_1()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sgtsv_no_pivot_strided_batch::rocsparse_sgtsv_no_pivot_strided_batch_rank_1 ( type(c_ptr)  handle,
integer(c_int)  m,
real(c_float), dimension(:), target  dl,
real(c_float), dimension(:), target  d,
real(c_float), dimension(:), target  du,
real(c_float), dimension(:), target  x,
integer(c_int)  batch_count,
integer(c_int)  batch_stride,
type(c_ptr)  temp_buffer 
)

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