| 1 |
//@HEADER |
| 2 |
// ************************************************************************ |
| 3 |
// |
| 4 |
// Kokkos v. 4.0 |
| 5 |
// Copyright (2022) National Technology & Engineering |
| 6 |
// Solutions of Sandia, LLC (NTESS). |
| 7 |
// |
| 8 |
// Under the terms of Contract DE-NA0003525 with NTESS, |
| 9 |
// the U.S. Government retains certain rights in this software. |
| 10 |
// |
| 11 |
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. |
| 12 |
// See https://kokkos.org/LICENSE for license information. |
| 13 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 14 |
// |
| 15 |
//@HEADER |
| 16 |
#ifndef KOKKOSBATCHED_TBSV_HPP_ |
| 17 |
#define KOKKOSBATCHED_TBSV_HPP_ |
| 18 |
|
| 19 |
#include <KokkosBatched_Util.hpp> |
| 20 |
|
| 21 |
/// \author Yuuichi Asahi ([email protected]) |
| 22 |
|
| 23 |
namespace KokkosBatched { |
| 24 |
|
| 25 |
/// \brief Serial Batched Tbsv: |
| 26 |
/// |
| 27 |
/// Solve Ab_l x_l = b_l for all l = 0, ..., N |
| 28 |
/// using the triangular solve algorithm Tbsv. Ab is an n by n unit, or |
| 29 |
/// non-unit, upper or lower triangular band matrix, with ( k + 1 ) |
| 30 |
/// diagonals. |
| 31 |
/// |
| 32 |
/// \tparam AViewType: Input type for the matrix, needs to be a 2D view |
| 33 |
/// \tparam XViewType: Input type for the right-hand side and the solution, |
| 34 |
/// needs to be a 1D view |
| 35 |
/// |
| 36 |
/// \param A [in]: A is a lda by n banded matrix, with ( k + 1 ) diagonals |
| 37 |
/// \param X [inout]: right-hand side and the solution, a rank 1 view |
| 38 |
/// \param k [in]: k specifies the number of superdiagonals or subdiagonals of |
| 39 |
/// matrix A. k >= 0 |
| 40 |
/// |
| 41 |
/// No nested parallel_for is used inside of the function. |
| 42 |
/// |
| 43 |
|
| 44 |
template <typename ArgUplo, typename ArgTrans, typename ArgDiag, typename ArgAlgo> |
| 45 |
struct SerialTbsv { |
| 46 |
template <typename AViewType, typename XViewType> |
| 47 |
KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &X, const int k); |
| 48 |
}; |
| 49 |
|
| 50 |
} // namespace KokkosBatched |
| 51 |
|
| 52 |
#include "KokkosBatched_Tbsv_Serial_Impl.hpp" |
| 53 |
|
| 54 |
#endif // KOKKOSBATCHED_TBSV_HPP_ |