Skip to content

Commit 0ad5b38

Browse files
committed
[Docs] Add batched serial gbtrf/gbtrs
Signed-off-by: yasahi-hpc <y.asahi6412@gmail.com>
1 parent 3480140 commit 0ad5b38

File tree

3 files changed

+106
-2
lines changed

3 files changed

+106
-2
lines changed

docs/source/API/batched/dense-index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ API: Batched Dense (DLA)
77

88
dense/batched_getrf
99
dense/batched_getrs
10+
dense/batched_gbtrf
11+
dense/batched_gbtrs
1012
dense/batched_pbtrf
1113
dense/batched_pbtrs
1214
dense/batched_pttrf
@@ -302,11 +304,11 @@ Below are tables summarizing the currently supported function calls in Kokkos Ke
302304
- `TeamGesv`
303305
- `TeamVectorGesv`
304306
* - gbtrf
305-
- `SerialGbtrf`
307+
- :doc:`SerialGbtrf <dense/batched_gbtrf>`
306308
- --
307309
- --
308310
* - gbtrs
309-
- `SerialGbtrs`
311+
- :doc:`SerialGbtrs <dense/batched_gbtrs>`
310312
- --
311313
- --
312314
* - pbtrf
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
KokkosBatched::Gbtrf
2+
####################
3+
4+
Defined in header: :code:`KokkosBatched_Gbtrf.hpp`
5+
6+
.. code:: c++
7+
8+
template <typename ArgAlgo>
9+
struct SerialGbtrf {
10+
template <typename ABViewType, typename PivViewType>
11+
KOKKOS_INLINE_FUNCTION
12+
static int
13+
invoke(const ABViewType &Ab, const PivViewType &piv, const int kl, const int ku,
14+
const int m = -1);
15+
};
16+
17+
Computes a LU factorization of a general m-by-n band matrix :math:`A` using partial pivoting with row interchanges. The factorization has the format
18+
:math:`A = P \cdot L \cdot U`.
19+
20+
where
21+
22+
- :math:`P` is a permutation matrix
23+
- :math:`L` is a lower triangular matrix with unit diagonal elements
24+
- :math:`U` is an upper triangular matrix
25+
26+
Parameters
27+
==========
28+
29+
:Ab: On input, :math:`Ab` is a m by n general band matrix :math:`A` in the band storage. On output, the factors :math:`L` and :math:`U` from the factorization :math:`A = P \cdot L \cdot U`. The unit diagonal elements of :math:`L` are not stored. See `LAPACK reference <https://www.netlib.org/lapack/lug/node124.html>`_ for the band storage format.
30+
:piv: On output, the pivot indices.
31+
:kl: The number of subdiagonals within the band of :math:`A`. kl >= 0
32+
:ku: The number of superdiagonals within the band of :math:`A`. ku >= 0
33+
:m: The number of rows of the matrix :math:`A`. (optional, default is -1, corresponding to m == n)
34+
35+
Type Requirements
36+
-----------------
37+
38+
- ``ArgAlgo`` must be ``KokkosBatched::Algo::Gbtrf::Unblocked`` for the unblocked algorithm
39+
- ``ABViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 2 containing the general band matrix :math:`A`
40+
- ``PivViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the pivot indices
41+
42+
Example
43+
=======
44+
45+
.. literalinclude:: ../../../../../example/batched_solve/serial_gbtrs.cpp
46+
:language: c++
47+
48+
output:
49+
50+
.. code::
51+
52+
gbtrf/gbtrs works correctly!
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
KokkosBatched::Gbtrs
2+
####################
3+
4+
Defined in header: :code:`KokkosBatched_Gbtrs.hpp`
5+
6+
.. code:: c++
7+
8+
template <typename ArgTrans, typename ArgAlgo>
9+
struct SerialGbtrs {
10+
template <typename AViewType, typename PivViewType, typename BViewType>
11+
KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const PivViewType &piv, const BViewType &b, const int kl,
12+
const int ku);
13+
};
14+
15+
Solves a system of the linear equations :math:`A \cdot X = B` or :math:`A^T \cdot X = B` or :math:`A^H \cdot X = B` with a general n-by-n band matrix :math:`A` using :math:`LU` factorization computed by ``Gbtrf``.
16+
This operation is equivalent to the LAPACK routine ``SGBTRS`` (``CGBTRS``) or ``DGBTRS`` (``ZGBTRS``) for single or double precision for real (complex) matrix.
17+
18+
Parameters
19+
==========
20+
21+
:A: Input view containing the factors :math:`L` and :math:`U` from the factorization :math:`A = P \cdot L \cdot U` of the band matrix :math:`A` computed by ``Gbtrf``. See `LAPACK reference <https://www.netlib.org/lapack/lug/node124.html>`_ for the band storage format.
22+
:piv: The pivot indices computed by ``Gbtrf``.
23+
:B: Input/output view containing the right-hand side on input and the solution on output.
24+
:kl: The number of subdiagonals within the band of :math:`A`. kl >= 0
25+
:ku: The number of superdiagonals within the band of :math:`A`. ku >= 0
26+
27+
Type Requirements
28+
-----------------
29+
30+
- ``ArgTrans`` must be one of the following:
31+
- ``KokkosBatched::Trans::NoTranspose`` to solve a system :math:`A \cdot X = B`
32+
- ``KokkosBatched::Trans::Transpose`` to solve a system :math:`A^T \cdot X = B`
33+
- ``KokkosBatched::Trans::ConjTranspose`` to solve a system :math:`A^H \cdot X = B`
34+
- ``ArgAlgo`` must be ``KokkosBatched::Algo::Gbtrs::Unblocked`` for the unblocked algorithm
35+
- ``AViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 2 containing the general band matrix :math:`A`
36+
- ``PivViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the pivot indices
37+
- ``BViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the right-hand side that satisfies
38+
- ``std::is_same_v<typename BViewType::value_type, typename BViewType::non_const_value_type> == true``
39+
40+
Example
41+
=======
42+
43+
.. literalinclude:: ../../../../../example/batched_solve/serial_gbtrs.cpp
44+
:language: c++
45+
46+
output:
47+
48+
.. code::
49+
50+
gbtrf/gbtrs works correctly!

0 commit comments

Comments
 (0)