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

[NFCI][SYCL] Eliminate sycl/builtins_utils_*.hpp #16931

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

aelovikov-intel
Copy link
Contributor

@aelovikov-intel aelovikov-intel commented Feb 7, 2025

Split the helpers they used to provide between the builtins implementation and sycl/detail/type_traits/vec_marray_traits.hpp.

Split the helper they used to provide between the builtins
implementation and `sycl/detail/type_traits/vec_marray_traits.hpp`.
Comment on lines +113 to +128
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()>;
};
Copy link
Contributor Author

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.

Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants