Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/source/API/batched/dense-index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ API: Batched Dense (DLA)

dense/batched_getrf
dense/batched_getrs
dense/batched_gbtrf
dense/batched_gbtrs
dense/batched_pbtrf
dense/batched_pbtrs
dense/batched_pttrf
Expand Down Expand Up @@ -302,11 +304,11 @@ Below are tables summarizing the currently supported function calls in Kokkos Ke
- `TeamGesv`
- `TeamVectorGesv`
* - gbtrf
- `SerialGbtrf`
- :doc:`SerialGbtrf <dense/batched_gbtrf>`
- --
- --
* - gbtrs
- `SerialGbtrs`
- :doc:`SerialGbtrs <dense/batched_gbtrs>`
- --
- --
* - pbtrf
Expand Down
52 changes: 52 additions & 0 deletions docs/source/API/batched/dense/batched_gbtrf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
KokkosBatched::Gbtrf
####################

Defined in header: :code:`KokkosBatched_Gbtrf.hpp`

.. code:: c++

template <typename ArgAlgo>
struct SerialGbtrf {
template <typename ABViewType, typename PivViewType>
KOKKOS_INLINE_FUNCTION
static int
invoke(const ABViewType &Ab, const PivViewType &piv, const int kl, const int ku,
const int m = -1);
};

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
:math:`A = P \cdot L \cdot U`.

where

- :math:`P` is a permutation matrix
- :math:`L` is a lower triangular matrix with unit diagonal elements
- :math:`U` is an upper triangular matrix

Parameters
==========

: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.
:piv: On output, the pivot indices.
:kl: The number of subdiagonals within the band of :math:`A`. kl >= 0
:ku: The number of superdiagonals within the band of :math:`A`. ku >= 0
:m: The number of rows of the matrix :math:`A`. (optional, default is -1, corresponding to m == n)

Type Requirements
-----------------

- ``ArgAlgo`` must be ``KokkosBatched::Algo::Gbtrf::Unblocked`` for the unblocked algorithm
- ``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`
- ``PivViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the pivot indices

Example
=======

.. literalinclude:: ../../../../../example/batched_solve/serial_gbtrs.cpp
:language: c++

output:

.. code::

gbtrf/gbtrs works correctly!
50 changes: 50 additions & 0 deletions docs/source/API/batched/dense/batched_gbtrs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
KokkosBatched::Gbtrs
####################

Defined in header: :code:`KokkosBatched_Gbtrs.hpp`

.. code:: c++

template <typename ArgTrans, typename ArgAlgo>
struct SerialGbtrs {
template <typename AViewType, typename PivViewType, typename BViewType>
KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const PivViewType &piv, const BViewType &b, const int kl,
const int ku);
};

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``.
This operation is equivalent to the LAPACK routine ``SGBTRS`` (``CGBTRS``) or ``DGBTRS`` (``ZGBTRS``) for single or double precision for real (complex) matrix.

Parameters
==========

: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.
:piv: The pivot indices computed by ``Gbtrf``.
:B: Input/output view containing the right-hand side on input and the solution on output.
:kl: The number of subdiagonals within the band of :math:`A`. kl >= 0
:ku: The number of superdiagonals within the band of :math:`A`. ku >= 0

Type Requirements
-----------------

- ``ArgTrans`` must be one of the following:
- ``KokkosBatched::Trans::NoTranspose`` to solve a system :math:`A \cdot X = B`
- ``KokkosBatched::Trans::Transpose`` to solve a system :math:`A^T \cdot X = B`
- ``KokkosBatched::Trans::ConjTranspose`` to solve a system :math:`A^H \cdot X = B`
- ``ArgAlgo`` must be ``KokkosBatched::Algo::Gbtrs::Unblocked`` for the unblocked algorithm
- ``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`
- ``PivViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the pivot indices
- ``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
- ``std::is_same_v<typename BViewType::value_type, typename BViewType::non_const_value_type> == true``

Example
=======

.. literalinclude:: ../../../../../example/batched_solve/serial_gbtrs.cpp
:language: c++

output:

.. code::

gbtrf/gbtrs works correctly!
2 changes: 1 addition & 1 deletion docs/source/API/batched/dense/batched_getrf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Defined in header: :code:`KokkosBatched_Getrf.hpp`
invoke(const AViewType &A, const PivViewType &piv);
};

Computes an LU factorization of a general m-by-n matrix :math:`A` using partial pivoting with row interchanges. The factorization has the format
Computes a LU factorization of a general m-by-n matrix :math:`A` using partial pivoting with row interchanges. The factorization has the format
:math:`A = P \cdot L \cdot U`

where
Expand Down
6 changes: 5 additions & 1 deletion docs/source/API/batched/dense/batched_getrs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Defined in header: :code:`KokkosBatched_Getrs.hpp`
invoke(const AViewType &A, const PivViewType &piv, const BViewType &b);
};

Solves a system of the linear equations :math:`A \cdot X = B` or :math:`A^T \cdot X = B` with a general n-by-n matrix :math:`A` using :math:`LU` factorization computed by ``Getrf``.
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 matrix :math:`A` using :math:`LU` factorization computed by ``Getrf``.
This operation is equivalent to the LAPACK routine ``SGETRS`` (``CGETRS``) or ``DGETRS`` (``ZGETRS``) for single or double precision for real (complex) matrix.

Parameters
Expand All @@ -26,6 +26,10 @@ Parameters
Type Requirements
-----------------

- ``ArgTrans`` must be one of the following:
- ``KokkosBatched::Trans::NoTranspose`` to solve a system :math:`A \cdot X = B`
- ``KokkosBatched::Trans::Transpose`` to solve a system :math:`A^T \cdot X = B`
- ``KokkosBatched::Trans::ConjTranspose`` to solve a system :math:`A^H \cdot X = B`
- ``ArgAlgo`` must be ``KokkosBatched::Algo::Getrs::Unblocked`` for the unblocked algorithm
- ``AViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 2 containing the general matrix :math:`A`
- ``PivViewType`` must be a Kokkos `View <https://kokkos.org/kokkos-core-wiki/API/core/view/view.html>`_ of rank 1 containing the pivot indices
Expand Down
Loading