Skip to content

Commit 25962d7

Browse files
author
Yuuichi Asahi
committed
fix: rename precision traits and improve comments
1 parent ab6ae19 commit 25962d7

File tree

2 files changed

+158
-96
lines changed

2 files changed

+158
-96
lines changed

common/src/KokkosFFT_traits.hpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ inline constexpr bool is_operatable_view_v =
131131

132132
// Traits for binary operations
133133
template <typename T1, typename T2, typename Enable = void>
134-
struct have_same_precision : std::false_type {};
134+
struct have_same_base_floating_point_type : std::false_type {};
135135

136136
template <typename T1, typename T2>
137-
struct have_same_precision<
137+
struct have_same_base_floating_point_type<
138138
T1, T2,
139139
std::enable_if_t<!Kokkos::is_view_v<T1> && !Kokkos::is_view_v<T2> &&
140140
std::is_same_v<base_floating_point_type<T1>,
141141
base_floating_point_type<T2>>>>
142142
: std::true_type {};
143143

144144
template <typename InViewType, typename OutViewType>
145-
struct have_same_precision<
145+
struct have_same_base_floating_point_type<
146146
InViewType, OutViewType,
147147
std::enable_if_t<
148148
Kokkos::is_view_v<InViewType> && Kokkos::is_view_v<OutViewType> &&
@@ -152,12 +152,12 @@ struct have_same_precision<
152152
typename OutViewType::non_const_value_type>>>>
153153
: std::true_type {};
154154

155-
/// \brief Helper to check if two value have the same base precision type.
155+
/// \brief Helper to check if two value have the same base floating point type.
156156
/// When applied to Kokkos::View, then check if values of views have the same
157-
/// base precision type.
157+
/// base floating point type.
158158
template <typename T1, typename T2>
159-
inline constexpr bool have_same_precision_v =
160-
have_same_precision<T1, T2>::value;
159+
inline constexpr bool have_same_base_floating_point_type_v =
160+
have_same_base_floating_point_type<T1, T2>::value;
161161

162162
template <typename InViewType, typename OutViewType, typename Enable = void>
163163
struct have_same_layout : std::false_type {};
@@ -199,12 +199,12 @@ struct are_operatable_views : std::false_type {};
199199
template <typename ExecutionSpace, typename InViewType, typename OutViewType>
200200
struct are_operatable_views<
201201
ExecutionSpace, InViewType, OutViewType,
202-
std::enable_if_t<is_operatable_view_v<ExecutionSpace, InViewType> &&
203-
is_operatable_view_v<ExecutionSpace, OutViewType> &&
204-
have_same_precision_v<InViewType, OutViewType> &&
205-
have_same_layout_v<InViewType, OutViewType> &&
206-
have_same_rank_v<InViewType, OutViewType>>>
207-
: std::true_type {};
202+
std::enable_if_t<
203+
is_operatable_view_v<ExecutionSpace, InViewType> &&
204+
is_operatable_view_v<ExecutionSpace, OutViewType> &&
205+
have_same_base_floating_point_type_v<InViewType, OutViewType> &&
206+
have_same_layout_v<InViewType, OutViewType> &&
207+
have_same_rank_v<InViewType, OutViewType>>> : std::true_type {};
208208

209209
/// \brief Helper to check if Views are acceptable View for Kokkos-FFT and
210210
/// memory space are accessible from the ExecutionSpace.

0 commit comments

Comments
 (0)