Skip to content

Commit 8293a5c

Browse files
[NFC][SYCL] Move a helper to its single legacy use (#12740)
Old builtins implementation is going to be removed in the next ABI breaking window and that helper is only used there.
1 parent d697024 commit 8293a5c

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

sycl/include/sycl/builtins_legacy_scalar.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@ inline constexpr bool is_non_deprecated_nan_type_v =
330330
std::is_same_v<get_elem_type_t<T>, uint16_t> ||
331331
std::is_same_v<get_elem_type_t<T>, uint32_t> ||
332332
std::is_same_v<get_elem_type_t<T>, uint64_t>;
333+
334+
template <typename T, typename B, typename Enable = void>
335+
struct convert_data_type_impl;
336+
337+
template <typename T, typename B>
338+
struct convert_data_type_impl<T, B, std::enable_if_t<is_sgentype_v<T>, T>> {
339+
B operator()(T t) { return static_cast<B>(t); }
340+
};
341+
342+
template <typename T, typename B>
343+
struct convert_data_type_impl<T, B, std::enable_if_t<is_vgentype_v<T>, T>> {
344+
vec<B, T::size()> operator()(T t) { return t.template convert<B>(); }
345+
};
346+
347+
template <typename T, typename B>
348+
using convert_data_type = convert_data_type_impl<T, B, T>;
333349
} // namespace detail
334350

335351
template <typename T>

sycl/include/sycl/detail/generic_type_traits.hpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -405,22 +405,6 @@ template <typename T>
405405
using make_unsinged_integer_t =
406406
make_type_t<T, gtl::scalar_unsigned_integer_list>;
407407

408-
template <typename T, typename B, typename Enable = void>
409-
struct convert_data_type_impl;
410-
411-
template <typename T, typename B>
412-
struct convert_data_type_impl<T, B, std::enable_if_t<is_sgentype_v<T>, T>> {
413-
B operator()(T t) { return static_cast<B>(t); }
414-
};
415-
416-
template <typename T, typename B>
417-
struct convert_data_type_impl<T, B, std::enable_if_t<is_vgentype_v<T>, T>> {
418-
vec<B, T::size()> operator()(T t) { return t.template convert<B>(); }
419-
};
420-
421-
template <typename T, typename B>
422-
using convert_data_type = convert_data_type_impl<T, B, T>;
423-
424408
// TryToGetElementType<T>::type is T::element_type or T::value_type if those
425409
// exist, otherwise T.
426410
template <typename T> class TryToGetElementType {

0 commit comments

Comments
 (0)