@@ -99,7 +99,7 @@ template<typename... Vs>
9999using broadcast_vector_extent_type = broadcast_extent<vector_extent_type<Vs>...>;
100100
101101template <typename From, typename To>
102- static constexpr bool is_broadcastable = is_same <broadcast_extent<From, To>, To>;
102+ static constexpr bool is_broadcastable = is_same_type <broadcast_extent<From, To>, To>;
103103
104104template <typename V, typename To>
105105static constexpr bool is_vector_broadcastable = is_broadcastable<vector_extent_type<V>, To>;
@@ -169,8 +169,12 @@ broadcast_like(const V& input, const R& other) {
169169}
170170
171171namespace detail {
172+ /* *
173+ * Convert vector of element type `T` and extent type `E` to vector of element type `T2` and extent type `E2`.
174+ * Specialization exist for the cases where `T==T2` and/or `E==E2`.
175+ */
172176template <typename T, typename E, typename T2, typename E2 , RoundingMode M = RoundingMode::ANY>
173- struct convert_helper {
177+ struct convert_impl {
174178 KERNEL_FLOAT_INLINE
175179 static vector_storage<T2, E2 ::value> call (vector_storage<T, E::value> input) {
176180 using F = ops::cast<T, T2, M>;
@@ -180,24 +184,27 @@ struct convert_helper {
180184 }
181185};
182186
187+ // T == T2, E == E2
183188template <typename T, typename E, RoundingMode M>
184- struct convert_helper <T, E, T, E, M> {
189+ struct convert_impl <T, E, T, E, M> {
185190 KERNEL_FLOAT_INLINE
186191 static vector_storage<T, E::value> call (vector_storage<T, E::value> input) {
187192 return input;
188193 }
189194};
190195
196+ // T == T2, E != E2
191197template <typename T, typename E, typename E2 , RoundingMode M>
192- struct convert_helper <T, E, T, E2 , M> {
198+ struct convert_impl <T, E, T, E2 , M> {
193199 KERNEL_FLOAT_INLINE
194200 static vector_storage<T, E2 ::value> call (vector_storage<T, E::value> input) {
195201 return detail::broadcast_impl<T, E, E2 >::call (input);
196202 }
197203};
198204
205+ // T != T2, E == E2
199206template <typename T, typename E, typename T2, RoundingMode M>
200- struct convert_helper <T, E, T2, E, M> {
207+ struct convert_impl <T, E, T2, E, M> {
201208 KERNEL_FLOAT_INLINE
202209 static vector_storage<T2, E::value> call (vector_storage<T, E::value> input) {
203210 using F = ops::cast<T, T2, M>;
@@ -208,8 +215,8 @@ struct convert_helper<T, E, T2, E, M> {
208215
209216template <typename R, size_t N, RoundingMode M = RoundingMode::ANY, typename V>
210217KERNEL_FLOAT_INLINE vector_storage<R, N> convert_storage (const V& input, extent<N> new_size = {}) {
211- return detail::convert_helper <vector_value_type<V>, vector_extent_type<V>, R, extent<N>, M>::
212- call ( into_vector_storage (input));
218+ return detail::convert_impl <vector_value_type<V>, vector_extent_type<V>, R, extent<N>, M>::call (
219+ into_vector_storage (input));
213220}
214221
215222/* *
0 commit comments