-
Notifications
You must be signed in to change notification settings - Fork 752
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
[NFCI][SYCL] Eliminate sycl/builtins_utils_*.hpp
#16931
base: sycl
Are you sure you want to change the base?
Conversation
Split the helper they used to provide between the builtins implementation and `sycl/detail/type_traits/vec_marray_traits.hpp`.
09b4d7d
to
a7bf1ca
Compare
template <typename NewElemT, typename T, typename = void> | ||
struct change_elements { | ||
using type = NewElemT; | ||
}; | ||
template <typename NewElemT, typename T> | ||
struct change_elements<NewElemT, T, std::enable_if_t<is_marray_v<T>>> { | ||
using type = | ||
marray<typename change_elements<NewElemT, typename T::value_type>::type, | ||
T::size()>; | ||
}; | ||
template <typename NewElemT, typename T> | ||
struct change_elements<NewElemT, T, std::enable_if_t<is_vec_or_swizzle_v<T>>> { | ||
using type = | ||
vec<typename change_elements<NewElemT, typename T::element_type>::type, | ||
T::size()>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't just copy-paste, I'm using SFINAE instead of plain partial specialization. Main reason is to avoid relying on swizzle's implementation outside vec_marray_traits.hpp
and I didn't think that this utility would fit there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Split the helpers they used to provide between the builtins implementation and
sycl/detail/type_traits/vec_marray_traits.hpp
.