| 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_TRSV_TEAMVECTOR_IMPL_HPP |
| 17 |
#define KOKKOSBATCHED_TRSV_TEAMVECTOR_IMPL_HPP |
| 18 |
|
| 19 |
/// \author Kyungjoo Kim ([email protected]) |
| 20 |
|
| 21 |
#include "KokkosBatched_Util.hpp" |
| 22 |
#include "KokkosBatched_Trsv_TeamVector_Internal.hpp" |
| 23 |
|
| 24 |
namespace KokkosBatched { |
| 25 |
/// |
| 26 |
/// Team Impl |
| 27 |
/// =========== |
| 28 |
|
| 29 |
/// |
| 30 |
/// Implemented: |
| 31 |
/// L/NT, U/NT, L/T, U/T |
| 32 |
/// |
| 33 |
/// Not yet implemented |
| 34 |
/// L/CT, U/CT |
| 35 |
|
| 36 |
/// |
| 37 |
/// L/NT |
| 38 |
/// |
| 39 |
|
| 40 |
template <typename MemberType, typename ArgDiag> |
| 41 |
struct TeamVectorTrsv<MemberType, Uplo::Lower, Trans::NoTranspose, ArgDiag, Algo::Trsv::Unblocked> { |
| 42 |
template <typename ScalarType, typename AViewType, typename bViewType> |
| 43 |
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const ScalarType alpha, const AViewType &A, |
| 44 |
const bViewType &b) { |
| 45 |
return TeamVectorTrsvInternalLower<Algo::Trsv::Unblocked>::invoke(member, ArgDiag::use_unit_diag, A.extent(0), |
| 46 |
alpha, A.data(), A.stride_0(), A.stride_1(), |
| 47 |
b.data(), b.stride_0()); |
| 48 |
} |
| 49 |
}; |
| 50 |
|
| 51 |
/// |
| 52 |
/// L/T |
| 53 |
/// |
| 54 |
|
| 55 |
template <typename MemberType, typename ArgDiag> |
| 56 |
struct TeamVectorTrsv<MemberType, Uplo::Lower, Trans::Transpose, ArgDiag, Algo::Trsv::Unblocked> { |
| 57 |
template <typename ScalarType, typename AViewType, typename bViewType> |
| 58 |
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const ScalarType alpha, const AViewType &A, |
| 59 |
const bViewType &b) { |
| 60 |
return TeamVectorTrsvInternalUpper<Algo::Trsv::Unblocked>::invoke(member, ArgDiag::use_unit_diag, A.extent(1), |
| 61 |
alpha, A.data(), A.stride_1(), A.stride_0(), |
| 62 |
b.data(), b.stride_0()); |
| 63 |
} |
| 64 |
}; |
| 65 |
|
| 66 |
/// |
| 67 |
/// U/NT |
| 68 |
/// |
| 69 |
|
| 70 |
template <typename MemberType, typename ArgDiag> |
| 71 |
struct TeamVectorTrsv<MemberType, Uplo::Upper, Trans::NoTranspose, ArgDiag, Algo::Trsv::Unblocked> { |
| 72 |
template <typename ScalarType, typename AViewType, typename bViewType> |
| 73 |
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const ScalarType alpha, const AViewType &A, |
| 74 |
const bViewType &b) { |
| 75 |
return TeamVectorTrsvInternalUpper<Algo::Trsv::Unblocked>::invoke(member, ArgDiag::use_unit_diag, A.extent(0), |
| 76 |
alpha, A.data(), A.stride_0(), A.stride_1(), |
| 77 |
b.data(), b.stride_0()); |
| 78 |
} |
| 79 |
}; |
| 80 |
|
| 81 |
/// |
| 82 |
/// U/T |
| 83 |
/// |
| 84 |
|
| 85 |
template <typename MemberType, typename ArgDiag> |
| 86 |
struct TeamVectorTrsv<MemberType, Uplo::Upper, Trans::Transpose, ArgDiag, Algo::Trsv::Unblocked> { |
| 87 |
template <typename ScalarType, typename AViewType, typename bViewType> |
| 88 |
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const ScalarType alpha, const AViewType &A, |
| 89 |
const bViewType &b) { |
| 90 |
return TeamVectorTrsvInternalLower<Algo::Trsv::Unblocked>::invoke(member, ArgDiag::use_unit_diag, A.extent(1), |
| 91 |
alpha, A.data(), A.stride_1(), A.stride_0(), |
| 92 |
b.data(), b.stride_0()); |
| 93 |
} |
| 94 |
}; |
| 95 |
|
| 96 |
} // namespace KokkosBatched |
| 97 |
|
| 98 |
#endif |