Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Refactor vector_arith* #16349

Merged
merged 15 commits into from
Dec 16, 2024
16 changes: 16 additions & 0 deletions sycl/include/sycl/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,22 @@ struct map_type<T, From, To, Rest...> {
template <typename T, typename... Ts>
constexpr bool check_type_in_v = ((std::is_same_v<T, Ts> || ...));

#if __has_builtin(__type_pack_element)
template <int N, typename... Ts>
using nth_type_t = __type_pack_element<N, Ts...>;
#else
template <int N, typename T, typename... Ts> struct nth_type {
using type = typename nth_type<N - 1, Ts...>::type;
};

template <typename T, typename... Ts> struct nth_type<0, T, Ts...> {
using type = T;
};

template <int N, typename... Ts>
using nth_type_t = typename nth_type<N, Ts...>::type;
#endif

} // namespace detail
} // namespace _V1
} // namespace sycl
Loading
Loading