Skip to content

Commit a1f66f9

Browse files
committed
Full reformat
1 parent 9ca5ba3 commit a1f66f9

File tree

870 files changed

+51772
-85743
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

870 files changed

+51772
-85743
lines changed

batched/KokkosBatched_Util.hpp

Lines changed: 96 additions & 180 deletions
Large diffs are not rendered by default.

batched/dense/impl/KokkosBatched_AddRadial_Impl.hpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ namespace KokkosBatched {
2828
/// ===========
2929

3030
template <typename ScalarType, typename AViewType>
31-
KOKKOS_INLINE_FUNCTION int SerialAddRadial::invoke(const ScalarType tiny,
32-
const AViewType &A) {
33-
return SerialAddRadialInternal::invoke(
34-
(A.extent(0) < A.extent(1) ? A.extent(0) : A.extent(1)), tiny, A.data(),
35-
(A.stride_0() + A.stride_1()));
31+
KOKKOS_INLINE_FUNCTION int SerialAddRadial::invoke(const ScalarType tiny, const AViewType &A) {
32+
return SerialAddRadialInternal::invoke((A.extent(0) < A.extent(1) ? A.extent(0) : A.extent(1)), tiny, A.data(),
33+
(A.stride_0() + A.stride_1()));
3634
}
3735

3836
///
@@ -41,11 +39,10 @@ KOKKOS_INLINE_FUNCTION int SerialAddRadial::invoke(const ScalarType tiny,
4139

4240
template <typename MemberType>
4341
template <typename ScalarType, typename AViewType>
44-
KOKKOS_INLINE_FUNCTION int TeamAddRadial<MemberType>::invoke(
45-
const MemberType &member, const ScalarType tiny, const AViewType &A) {
46-
return TeamAddRadialInternal::invoke(
47-
member, (A.extent(0) < A.extent(1) ? A.extent(0) : A.extent(1)), tiny,
48-
A.data(), (A.stride_0() + A.stride_1()));
42+
KOKKOS_INLINE_FUNCTION int TeamAddRadial<MemberType>::invoke(const MemberType &member, const ScalarType tiny,
43+
const AViewType &A) {
44+
return TeamAddRadialInternal::invoke(member, (A.extent(0) < A.extent(1) ? A.extent(0) : A.extent(1)), tiny, A.data(),
45+
(A.stride_0() + A.stride_1()));
4946
}
5047

5148
} // end namespace KokkosBatched

batched/dense/impl/KokkosBatched_AddRadial_Internal.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ namespace KokkosBatched {
2828
struct SerialAddRadialInternal {
2929
template <typename ScalarType, typename ValueType>
3030
KOKKOS_INLINE_FUNCTION static int invoke(const int m, const ScalarType tiny,
31-
/* */ ValueType *KOKKOS_RESTRICT A,
32-
const int as) {
31+
/* */ ValueType *KOKKOS_RESTRICT A, const int as) {
3332
const auto abs_tiny = tiny > 0 ? tiny : -tiny;
3433
const auto minus_abs_tiny = -abs_tiny;
3534

@@ -52,10 +51,8 @@ struct SerialAddRadialInternal {
5251
/// ==================
5352
struct TeamAddRadialInternal {
5453
template <typename MemberType, typename ScalarType, typename ValueType>
55-
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member,
56-
const int m, const ScalarType tiny,
57-
/* */ ValueType *KOKKOS_RESTRICT A,
58-
const int as) {
54+
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const int m, const ScalarType tiny,
55+
/* */ ValueType *KOKKOS_RESTRICT A, const int as) {
5956
const auto abs_tiny = tiny > 0 ? tiny : -tiny;
6057
const auto minus_abs_tiny = -abs_tiny;
6158

batched/dense/impl/KokkosBatched_ApplyGivens_Serial_Internal.hpp

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ namespace KokkosBatched {
3030
///
3131
struct SerialApplyLeftGivensInternal {
3232
template <typename ValueType>
33-
KOKKOS_INLINE_FUNCTION static int invoke(
34-
const Kokkos::pair<ValueType, ValueType> G, const int n,
35-
/* */ ValueType *a1t, const int a1ts,
36-
/* */ ValueType *a2t, const int a2ts) {
33+
KOKKOS_INLINE_FUNCTION static int invoke(const Kokkos::pair<ValueType, ValueType> G, const int n,
34+
/* */ ValueType *a1t, const int a1ts,
35+
/* */ ValueType *a2t, const int a2ts) {
3736
typedef ValueType value_type;
3837
if (n == 0) return 0; // quick return
3938
if (G.first == value_type(1) && G.second == value_type(0)) return 0;
@@ -59,10 +58,9 @@ struct SerialApplyLeftGivensInternal {
5958

6059
struct SerialApplyRightGivensInternal {
6160
template <typename ValueType>
62-
KOKKOS_INLINE_FUNCTION static int invoke(
63-
const Kokkos::pair<ValueType, ValueType> G, const int m,
64-
/* */ ValueType *a1, const int a1s,
65-
/* */ ValueType *a2, const int a2s) {
61+
KOKKOS_INLINE_FUNCTION static int invoke(const Kokkos::pair<ValueType, ValueType> G, const int m,
62+
/* */ ValueType *a1, const int a1s,
63+
/* */ ValueType *a2, const int a2s) {
6664
typedef ValueType value_type;
6765
if (m == 0) return 0; // quick return
6866
if (G.first == value_type(1) && G.second == value_type(0)) return 0;
@@ -88,12 +86,11 @@ struct SerialApplyRightGivensInternal {
8886

8987
struct SerialApplyLeftRightGivensInternal {
9088
template <typename ValueType>
91-
KOKKOS_INLINE_FUNCTION static int invoke(
92-
const Kokkos::pair<ValueType, ValueType> &G12, const int &m, const int &n,
93-
/* */ ValueType *KOKKOS_RESTRICT a1t,
94-
/* */ ValueType *KOKKOS_RESTRICT a2t,
95-
/* */ ValueType *KOKKOS_RESTRICT a1,
96-
/* */ ValueType *KOKKOS_RESTRICT a2, const int &as0, const int &as1) {
89+
KOKKOS_INLINE_FUNCTION static int invoke(const Kokkos::pair<ValueType, ValueType> &G12, const int &m, const int &n,
90+
/* */ ValueType *KOKKOS_RESTRICT a1t,
91+
/* */ ValueType *KOKKOS_RESTRICT a2t,
92+
/* */ ValueType *KOKKOS_RESTRICT a1,
93+
/* */ ValueType *KOKKOS_RESTRICT a2, const int &as0, const int &as1) {
9794
typedef ValueType value_type;
9895
if (G12.first == value_type(1) && G12.second == value_type(0)) return 0;
9996
if (m == 0 && n == 0) return 0; // quick return
@@ -124,15 +121,14 @@ struct SerialApplyLeftRightGivensInternal {
124121
}
125122

126123
template <typename ValueType>
127-
KOKKOS_INLINE_FUNCTION static int invoke(
128-
const Kokkos::pair<ValueType, ValueType> &G12,
129-
const Kokkos::pair<ValueType, ValueType> &G13, const int &m, const int &n,
130-
/* */ ValueType *KOKKOS_RESTRICT a1t,
131-
/* */ ValueType *KOKKOS_RESTRICT a2t,
132-
/* */ ValueType *KOKKOS_RESTRICT a3t,
133-
/* */ ValueType *KOKKOS_RESTRICT a1,
134-
/* */ ValueType *KOKKOS_RESTRICT a2,
135-
/* */ ValueType *KOKKOS_RESTRICT a3, const int &as0, const int &as1) {
124+
KOKKOS_INLINE_FUNCTION static int invoke(const Kokkos::pair<ValueType, ValueType> &G12,
125+
const Kokkos::pair<ValueType, ValueType> &G13, const int &m, const int &n,
126+
/* */ ValueType *KOKKOS_RESTRICT a1t,
127+
/* */ ValueType *KOKKOS_RESTRICT a2t,
128+
/* */ ValueType *KOKKOS_RESTRICT a3t,
129+
/* */ ValueType *KOKKOS_RESTRICT a1,
130+
/* */ ValueType *KOKKOS_RESTRICT a2,
131+
/* */ ValueType *KOKKOS_RESTRICT a3, const int &as0, const int &as1) {
136132
typedef ValueType value_type;
137133
if (m == 0 && n == 0) return 0; // quick return
138134

batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Impl.hpp

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,21 @@ namespace KokkosBatched {
2828
/// ===========
2929

3030
template <>
31-
template <typename uViewType, typename tauViewType, typename AViewType,
32-
typename wViewType>
33-
KOKKOS_INLINE_FUNCTION int SerialApplyHouseholder<Side::Left>::invoke(
34-
const uViewType &u2, const tauViewType &tau, const AViewType &A,
35-
const wViewType &w) {
36-
return SerialApplyLeftHouseholderInternal::invoke(
37-
A.extent(0) - 1, A.extent(1), tau.data(), u2.data(), u2.stride(0),
38-
A.data(), A.stride(1), A.data() + A.stride(0), A.stride(0), A.stride(1),
39-
w.data());
31+
template <typename uViewType, typename tauViewType, typename AViewType, typename wViewType>
32+
KOKKOS_INLINE_FUNCTION int SerialApplyHouseholder<Side::Left>::invoke(const uViewType &u2, const tauViewType &tau,
33+
const AViewType &A, const wViewType &w) {
34+
return SerialApplyLeftHouseholderInternal::invoke(A.extent(0) - 1, A.extent(1), tau.data(), u2.data(), u2.stride(0),
35+
A.data(), A.stride(1), A.data() + A.stride(0), A.stride(0),
36+
A.stride(1), w.data());
4037
}
4138

4239
template <>
43-
template <typename uViewType, typename tauViewType, typename AViewType,
44-
typename wViewType>
45-
KOKKOS_INLINE_FUNCTION int SerialApplyHouseholder<Side::Right>::invoke(
46-
const uViewType &u2, const tauViewType &tau, const AViewType &A,
47-
const wViewType &w) {
48-
return SerialApplyRightHouseholderInternal::invoke(
49-
A.extent(0), A.extent(1) - 1, tau.data(), u2.data(), u2.stride(0),
50-
A.data(), A.stride(0), A.data() + A.stride(1), A.stride(0), A.stride(1),
51-
w.data());
40+
template <typename uViewType, typename tauViewType, typename AViewType, typename wViewType>
41+
KOKKOS_INLINE_FUNCTION int SerialApplyHouseholder<Side::Right>::invoke(const uViewType &u2, const tauViewType &tau,
42+
const AViewType &A, const wViewType &w) {
43+
return SerialApplyRightHouseholderInternal::invoke(A.extent(0), A.extent(1) - 1, tau.data(), u2.data(), u2.stride(0),
44+
A.data(), A.stride(0), A.data() + A.stride(1), A.stride(0),
45+
A.stride(1), w.data());
5246
}
5347

5448
} // namespace KokkosBatched

batched/dense/impl/KokkosBatched_ApplyHouseholder_Serial_Internal.hpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ namespace KokkosBatched {
3030
///
3131
struct SerialApplyLeftHouseholderInternal {
3232
template <typename ValueType>
33-
KOKKOS_INLINE_FUNCTION static int invoke(const int m, const int n,
34-
const ValueType* tau,
33+
KOKKOS_INLINE_FUNCTION static int invoke(const int m, const int n, const ValueType* tau,
3534
/* */ ValueType* u2, const int u2s,
3635
/* */ ValueType* a1t, const int a1ts,
37-
/* */ ValueType* A2, const int as0,
38-
const int as1,
36+
/* */ ValueType* A2, const int as0, const int as1,
3937
/* */ ValueType* w1t) {
4038
typedef ValueType value_type;
4139

@@ -55,9 +53,7 @@ struct SerialApplyLeftHouseholderInternal {
5553
// w1t /= tau
5654
for (int j = 0; j < n; ++j) {
5755
value_type tmp = a1t[j * a1ts];
58-
for (int i = 0; i < m; ++i)
59-
tmp += Kokkos::ArithTraits<value_type>::conj(u2[i * u2s]) *
60-
A2[i * as0 + j * as1];
56+
for (int i = 0; i < m; ++i) tmp += Kokkos::ArithTraits<value_type>::conj(u2[i * u2s]) * A2[i * as0 + j * as1];
6157
w1t[j] = tmp * inv_tau; // /= (*tau);
6258
}
6359

@@ -74,12 +70,10 @@ struct SerialApplyLeftHouseholderInternal {
7470

7571
struct SerialApplyRightHouseholderInternal {
7672
template <typename ValueType>
77-
KOKKOS_INLINE_FUNCTION static int invoke(const int m, const int n,
78-
const ValueType* tau,
73+
KOKKOS_INLINE_FUNCTION static int invoke(const int m, const int n, const ValueType* tau,
7974
/* */ ValueType* u2, const int u2s,
8075
/* */ ValueType* a1, const int a1s,
81-
/* */ ValueType* A2, const int as0,
82-
const int as1,
76+
/* */ ValueType* A2, const int as0, const int as1,
8377
/* */ ValueType* w1) {
8478
typedef ValueType value_type;
8579
/// u2 n x 1
@@ -107,9 +101,7 @@ struct SerialApplyRightHouseholderInternal {
107101

108102
// A2 -= w1 * u2' (ger with conjugate)
109103
for (int j = 0; j < n; ++j)
110-
for (int i = 0; i < m; ++i)
111-
A2[i * as0 + j * as1] -=
112-
w1[i] * Kokkos::ArithTraits<ValueType>::conj(u2[j * u2s]);
104+
for (int i = 0; i < m; ++i) A2[i * as0 + j * as1] -= w1[i] * Kokkos::ArithTraits<ValueType>::conj(u2[j * u2s]);
113105

114106
return 0;
115107
}

batched/dense/impl/KokkosBatched_ApplyHouseholder_TeamVector_Impl.hpp

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,23 @@ namespace KokkosBatched {
2929

3030
template <typename MemberType>
3131
struct TeamVectorApplyHouseholder<MemberType, Side::Left> {
32-
template <typename uViewType, typename tauViewType, typename AViewType,
33-
typename wViewType>
34-
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member,
35-
const uViewType &u2,
36-
const tauViewType &tau,
37-
const AViewType &A,
38-
const wViewType &w) {
39-
return TeamVectorApplyLeftHouseholderInternal::invoke(
40-
member, A.extent(0) - 1, A.extent(1), tau.data(), u2.data(),
41-
u2.stride(0), A.data(), A.stride(1), A.data() + A.stride(0),
42-
A.stride(0), A.stride(1), w.data());
32+
template <typename uViewType, typename tauViewType, typename AViewType, typename wViewType>
33+
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const uViewType &u2, const tauViewType &tau,
34+
const AViewType &A, const wViewType &w) {
35+
return TeamVectorApplyLeftHouseholderInternal::invoke(member, A.extent(0) - 1, A.extent(1), tau.data(), u2.data(),
36+
u2.stride(0), A.data(), A.stride(1), A.data() + A.stride(0),
37+
A.stride(0), A.stride(1), w.data());
4338
}
4439
};
4540

4641
template <typename MemberType>
4742
struct TeamVectorApplyHouseholder<MemberType, Side::Right> {
48-
template <typename uViewType, typename tauViewType, typename AViewType,
49-
typename wViewType>
50-
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member,
51-
const uViewType &u2,
52-
const tauViewType &tau,
53-
const AViewType &A,
54-
const wViewType &w) {
55-
return TeamVectorApplyRightHouseholderInternal::invoke(
56-
member, A.extent(0), A.extent(1) - 1, tau.data(), u2.data(),
57-
u2.stride(0), A.data(), A.stride(0), A.data() + A.stride(1),
58-
A.stride(0), A.stride(1), w.data());
43+
template <typename uViewType, typename tauViewType, typename AViewType, typename wViewType>
44+
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const uViewType &u2, const tauViewType &tau,
45+
const AViewType &A, const wViewType &w) {
46+
return TeamVectorApplyRightHouseholderInternal::invoke(member, A.extent(0), A.extent(1) - 1, tau.data(), u2.data(),
47+
u2.stride(0), A.data(), A.stride(0), A.data() + A.stride(1),
48+
A.stride(0), A.stride(1), w.data());
5949
}
6050
};
6151

0 commit comments

Comments
 (0)