Debian Codegraph @

packages/kokkos-kernels/batched/dense/impl/KokkosBatched_ApplyQ_Serial_Impl.hpp

raw
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_APPLY_Q_SERIAL_IMPL_HPP
17 #define KOKKOSBATCHED_APPLY_Q_SERIAL_IMPL_HPP
18
19 /// \author Kyungjoo Kim ([email protected])
20
21 #include "KokkosBatched_Util.hpp"
22 #include "KokkosBatched_ApplyQ_Serial_Internal.hpp"
23
24 namespace KokkosBatched {
25
26 ///
27 /// Serial Impl
28 /// ===========
29
30 template <>
31 template <typename AViewType, typename tViewType, typename BViewType, typename wViewType>
32 KOKKOS_INLINE_FUNCTION int SerialApplyQ<Side::Left, Trans::NoTranspose, Algo::ApplyQ::Unblocked>::invoke(
33 const AViewType &A, const tViewType &t, const BViewType &B, const wViewType &w) {
34 return SerialApplyQ_LeftForwardInternal::invoke(B.extent(0), B.extent(1), A.extent(1), A.data(), A.stride_0(),
35 A.stride_1(), t.data(), t.stride_0(), B.data(), B.stride_0(),
36 B.stride_1(), w.data());
37 }
38
39 template <>
40 template <typename AViewType, typename tViewType, typename BViewType, typename wViewType>
41 KOKKOS_INLINE_FUNCTION int SerialApplyQ<Side::Left, Trans::Transpose, Algo::ApplyQ::Unblocked>::invoke(
42 const AViewType &A, const tViewType &t, const BViewType &B, const wViewType &w) {
43 return SerialApplyQ_LeftBackwardInternal::invoke(B.extent(0), B.extent(1), A.extent(1), A.data(), A.stride_0(),
44 A.stride_1(), t.data(), t.stride_0(), B.data(), B.stride_0(),
45 B.stride_1(), w.data());
46 }
47
48 template <>
49 template <typename AViewType, typename tViewType, typename BViewType, typename wViewType>
50 KOKKOS_INLINE_FUNCTION int SerialApplyQ<Side::Right, Trans::NoTranspose, Algo::ApplyQ::Unblocked>::invoke(
51 const AViewType &A, const tViewType &t, const BViewType &B, const wViewType &w) {
52 return SerialApplyQ_RightForwardInternal::invoke(B.extent(0), B.extent(1), A.extent(1), A.data(), A.stride_0(),
53 A.stride_1(), t.data(), t.stride_0(), B.data(), B.stride_0(),
54 B.stride_1(), w.data());
55 }
56
57 } // namespace KokkosBatched
58
59 #endif