Skip to content

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

@aelovikov-intel aelovikov-intel merged commit eaff40c into intel:sycl Feb 10, 2025
16 checks passed
@aelovikov-intel aelovikov-intel deleted the remove-builtin-utils branch February 10, 2025 14:46
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