Skip to content

Commit af6aa41

Browse files
[NFCI][SYCL] Refactor sycl::detail::make_unsigned (#16905)
Avoid using partial specialization for swizzles as it depends on the swizzles implementation and we'll be making significant changes there to align with the proposed specification changes.
1 parent 14d5771 commit af6aa41

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sycl/include/sycl/detail/type_traits.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ template <typename T, typename R> struct copy_cv_qualifiers {
218218
};
219219

220220
// make_unsigned with support SYCL vec class
221-
template <typename T> struct make_unsigned {
221+
template <typename T, typename = void> struct make_unsigned {
222222
using type = std::make_unsigned_t<T>;
223223
};
224224
template <typename T> using make_unsigned_t = typename make_unsigned<T>::type;
@@ -228,11 +228,10 @@ template <class T> struct make_unsigned<const T> {
228228
template <class T, int N> struct make_unsigned<vec<T, N>> {
229229
using type = vec<make_unsigned_t<T>, N>;
230230
};
231-
template <typename VecT, typename OperationLeftT, typename OperationRightT,
232-
template <typename> class OperationCurrentT, int... Indexes>
233-
struct make_unsigned<SwizzleOp<VecT, OperationLeftT, OperationRightT,
234-
OperationCurrentT, Indexes...>> {
235-
using type = make_unsigned_t<std::remove_cv_t<VecT>>;
231+
232+
template <typename T>
233+
struct make_unsigned<T, std::enable_if_t<is_swizzle_v<T>>> {
234+
using type = make_unsigned_t<vec<typename T::element_type, T::size()>>;
236235
};
237236
template <class T, std::size_t N> struct make_unsigned<marray<T, N>> {
238237
using type = marray<make_unsigned_t<T>, N>;

0 commit comments

Comments
 (0)