Debian Codegraph @

packages/kokkos-kernels/batched/dense/impl/KokkosBatched_UpdateGivens_Internal.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_UPDATE_GIVENS_INTERNAL_HPP
17 #define KOKKOSBATCHED_UPDATE_GIVENS_INTERNAL_HPP
18
19 /// \author Kyungjoo Kim ([email protected])
20
21 #include "KokkosBatched_Util.hpp"
22
23 namespace KokkosBatched {
24
25 ///
26 /// Serial Internal Impl
27 /// ====================
28 ///
29 /// this impl follows the flame interface of householder transformation
30 ///
31 struct SerialUpdateGivensInternal {
32 template <typename ValueType>
33 KOKKOS_INLINE_FUNCTION static int invoke(const Kokkos::pair<ValueType, ValueType> &S,
34 /* */ Kokkos::pair<ValueType, ValueType> &G) {
35 const ValueType tmp = S.first * G.first - S.second * G.second;
36 G.second = S.first * G.second + S.second * G.first;
37 G.first = tmp;
38
39 return 0;
40 }
41 };
42
43 } // end namespace KokkosBatched
44
45 #endif