@@ -32,22 +32,37 @@ template <typename DataT, int NumElements> class __SYCL_EBO vec;
32
32
template <typename DataT, std::size_t N> class marray ;
33
33
34
34
namespace detail {
35
+ #if __SYCL_USE_LIBSYCL8_VEC_IMPL
35
36
template <typename VecT, typename OperationLeftT, typename OperationRightT,
36
37
template <typename > class OperationCurrentT , int ... Indexes>
37
38
class SwizzleOp ;
39
+ #else
40
+ namespace hide_swizzle_from_adl {
41
+ template <bool IsConstVec, typename DataT, int VecSize, int ... Indexes>
42
+ class __SYCL_EBO Swizzle;
43
+ }
44
+ #endif
38
45
39
46
// Utility for converting a swizzle to a vector or preserve the type if it isn't
40
47
// a swizzle.
41
48
template <typename T> struct simplify_if_swizzle {
42
49
using type = T;
43
50
};
44
51
52
+ #if __SYCL_USE_LIBSYCL8_VEC_IMPL
45
53
template <typename VecT, typename OperationLeftT, typename OperationRightT,
46
54
template <typename > class OperationCurrentT , int ... Indexes>
47
55
struct simplify_if_swizzle <SwizzleOp<VecT, OperationLeftT, OperationRightT,
48
56
OperationCurrentT, Indexes...>> {
49
57
using type = vec<typename VecT::element_type, sizeof ...(Indexes)>;
50
58
};
59
+ #else
60
+ template <bool IsConstVec, typename DataT, int VecSize, int ... Indexes>
61
+ struct simplify_if_swizzle <detail::hide_swizzle_from_adl::Swizzle<
62
+ IsConstVec, DataT, VecSize, Indexes...>> {
63
+ using type = vec<DataT, sizeof ...(Indexes)>;
64
+ };
65
+ #endif
51
66
52
67
template <typename T>
53
68
using simplify_if_swizzle_t = typename simplify_if_swizzle<T>::type;
@@ -79,10 +94,17 @@ inline constexpr bool is_valid_type_for_ext_vector_v =
79
94
is_valid_type_for_ext_vector<T>::value;
80
95
81
96
template <typename > struct is_swizzle : std::false_type {};
97
+ #if __SYCL_USE_LIBSYCL8_VEC_IMPL
82
98
template <typename VecT, typename OperationLeftT, typename OperationRightT,
83
99
template <typename > class OperationCurrentT , int ... Indexes>
84
100
struct is_swizzle <SwizzleOp<VecT, OperationLeftT, OperationRightT,
85
101
OperationCurrentT, Indexes...>> : std::true_type {};
102
+ #else
103
+ template <bool IsConstVec, typename DataT, int VecSize, int ... Indexes>
104
+ struct is_swizzle <detail::hide_swizzle_from_adl::Swizzle<IsConstVec, DataT,
105
+ VecSize, Indexes...>>
106
+ : std::true_type {};
107
+ #endif
86
108
template <typename T> constexpr bool is_swizzle_v = is_swizzle<T>::value;
87
109
88
110
template <typename T>
@@ -108,11 +130,18 @@ struct num_elements<T __attribute__((ext_vector_type(N)))>
108
130
: std::integral_constant<std::size_t, N> {};
109
131
#endif
110
132
#endif
133
+ #if __SYCL_USE_LIBSYCL8_VEC_IMPL
111
134
template <typename VecT, typename OperationLeftT, typename OperationRightT,
112
135
template <typename > class OperationCurrentT , int ... Indexes>
113
136
struct num_elements <SwizzleOp<VecT, OperationLeftT, OperationRightT,
114
137
OperationCurrentT, Indexes...>>
115
138
: std::integral_constant<std::size_t , sizeof ...(Indexes)> {};
139
+ #else
140
+ template <bool IsConstVec, typename DataT, int VecSize, int ... Indexes>
141
+ struct num_elements <detail::hide_swizzle_from_adl::Swizzle<IsConstVec, DataT,
142
+ VecSize, Indexes...>>
143
+ : std::integral_constant<std::size_t , sizeof ...(Indexes)> {};
144
+ #endif
116
145
117
146
template <typename T>
118
147
inline constexpr std::size_t num_elements_v = num_elements<T>::value;
0 commit comments