hipsparsesgtsv2stridedbatch Interface Reference#
Strided batch tridiagonal solver (no pivoting). More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsesgtsv2stridedbatch_ (handle, m, dl, d, du, x, batchcount, batchstride, pbuffer) |
| integer(kind(hipsparse_status_success)) function | hipsparsesgtsv2stridedbatch_rank_0 (handle, m, dl, d, du, x, batchcount, batchstride, pbuffer) |
| integer(kind(hipsparse_status_success)) function | hipsparsesgtsv2stridedbatch_rank_1 (handle, m, dl, d, du, x, batchcount, batchstride, pbuffer) |
Detailed Description
Strided batch tridiagonal solver (no pivoting).
hipsparseXgtsv2StridedBatch solves a batched tridiagonal linear system
\[ T^{i}*x^{i} = x^{i} \]
where for each batch \(i=0\ldots\) batchCount, \(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 the strided memory pattern.
Solving the batched tridiagonal system involves two steps. First, the user calls hipsparseSgtsv2StridedBatch_bufferSizeExt "hipsparseXgtsv2StridedBatch_bufferSizeExt()" to determine the size of the required temporary storage buffer. After this is determined, the user allocates this buffer and passes it to hipsparseSgtsv2StridedBatch "hipsparseXgtsv2StridedBatch()" 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 hipsparseSgtsv2StridedBatch "hipsparseXgtsv2StridedBatch()".
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*batchStride entries are zero, and for the upper array, the i*batchStride+batchStride-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.
- Parameters
-
[in] handle - handle to the hipSPARSE library context queue. [in] m - size of the tridiagonal linear system (must be >= 2). [in] dl - lower diagonal of the tridiagonal system. The first entry must be zero. [in] d - main diagonal of the tridiagonal system. [in] du - upper diagonal of the tridiagonal system. The last entry must be zero. [in,out] x - Dense array of right-hand sides where the ith right-hand side starts at x+batchStride*i.[in] batchCount - The number of systems to solve. [in] batchStride - The number of elements that separate each system, which must satisfy batchStride>= m.[in] pBuffer - temporary storage buffer allocated by the user.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_INVALID_VALUE handle,m,batchCount,batchStride,dl,d,du,x, orpBufferpointer is invalid.HIPSPARSE_STATUS_INTERNAL_ERROR an internal error occurred.
Member Function/Subroutine Documentation
◆ hipsparsesgtsv2stridedbatch_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgtsv2stridedbatch::hipsparsesgtsv2stridedbatch_ | ( | 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 | batchcount, | ||
| integer(c_int), value | batchstride, | ||
| type(c_ptr), value | pbuffer | ||
| ) |
◆ hipsparsesgtsv2stridedbatch_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgtsv2stridedbatch::hipsparsesgtsv2stridedbatch_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) | batchcount, | ||
| integer(c_int) | batchstride, | ||
| type(c_ptr) | pbuffer | ||
| ) |
◆ hipsparsesgtsv2stridedbatch_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgtsv2stridedbatch::hipsparsesgtsv2stridedbatch_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) | batchcount, | ||
| integer(c_int) | batchstride, | ||
| type(c_ptr) | pbuffer | ||
| ) |
The documentation for this interface was generated from the following file: