Skip to content

Commit

Permalink
[NFC][SYCL] Move a helper to its single legacy use
Browse files Browse the repository at this point in the history
Old builtins implementation is going to be removed in the next ABI
breaking window and that helper is only used there.
  • Loading branch information
aelovikov-intel committed Feb 16, 2024
1 parent 76bbf93 commit 29248ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 16 additions & 0 deletions sycl/include/sycl/builtins_legacy_scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,22 @@ inline constexpr bool is_non_deprecated_nan_type_v =
std::is_same_v<get_elem_type_t<T>, uint16_t> ||
std::is_same_v<get_elem_type_t<T>, uint32_t> ||
std::is_same_v<get_elem_type_t<T>, uint64_t>;

template <typename T, typename B, typename Enable = void>
struct convert_data_type_impl;

template <typename T, typename B>
struct convert_data_type_impl<T, B, std::enable_if_t<is_sgentype_v<T>, T>> {
B operator()(T t) { return static_cast<B>(t); }
};

template <typename T, typename B>
struct convert_data_type_impl<T, B, std::enable_if_t<is_vgentype_v<T>, T>> {
vec<B, T::size()> operator()(T t) { return t.template convert<B>(); }
};

template <typename T, typename B>
using convert_data_type = convert_data_type_impl<T, B, T>;
} // namespace detail

template <typename T>
Expand Down
16 changes: 0 additions & 16 deletions sycl/include/sycl/detail/generic_type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,22 +405,6 @@ template <typename T>
using make_unsinged_integer_t =
make_type_t<T, gtl::scalar_unsigned_integer_list>;

template <typename T, typename B, typename Enable = void>
struct convert_data_type_impl;

template <typename T, typename B>
struct convert_data_type_impl<T, B, std::enable_if_t<is_sgentype_v<T>, T>> {
B operator()(T t) { return static_cast<B>(t); }
};

template <typename T, typename B>
struct convert_data_type_impl<T, B, std::enable_if_t<is_vgentype_v<T>, T>> {
vec<B, T::size()> operator()(T t) { return t.template convert<B>(); }
};

template <typename T, typename B>
using convert_data_type = convert_data_type_impl<T, B, T>;

// TryToGetElementType<T>::type is T::element_type or T::value_type if those
// exist, otherwise T.
template <typename T> class TryToGetElementType {
Expand Down

0 comments on commit 29248ca

Please sign in to comment.