@@ -2117,6 +2117,14 @@ using select_apply_cl_t =
2117
2117
GET_CL_TYPE (int , num), GET_CL_TYPE(long , num)>; \
2118
2118
};
2119
2119
2120
+ #define DECLARE_BOOL_CONVERTER (num ) \
2121
+ template <> class BaseCLTypeConverter <bool , num> { \
2122
+ public: \
2123
+ using DataType = detail::select_apply_cl_t < \
2124
+ bool , GET_CL_TYPE(char , num), GET_CL_TYPE(short , num), \
2125
+ GET_CL_TYPE (int , num), GET_CL_TYPE(long , num)>; \
2126
+ };
2127
+
2120
2128
#define DECLARE_HALF_CONVERTER (base, num ) \
2121
2129
template <> class BaseCLTypeConverter <base, num> { \
2122
2130
public: \
@@ -2129,6 +2137,12 @@ using select_apply_cl_t =
2129
2137
using DataType = schar; \
2130
2138
};
2131
2139
2140
+ #define DECLARE_SCALAR_BOOL_CONVERTER \
2141
+ template <> class BaseCLTypeConverter <bool , 1 > { \
2142
+ public: \
2143
+ using DataType = bool ; \
2144
+ };
2145
+
2132
2146
#define DECLARE_SCALAR_CONVERTER (base ) \
2133
2147
template <> class BaseCLTypeConverter <base, 1 > { \
2134
2148
public: \
@@ -2212,8 +2226,19 @@ using select_apply_cl_t =
2212
2226
DECLARE_SCALAR_SCHAR_CONVERTER \
2213
2227
} // namespace detail
2214
2228
2229
+ #define DECLARE_BOOL_VECTOR_CONVERTERS \
2230
+ namespace detail { \
2231
+ DECLARE_BOOL_CONVERTER (2 ) \
2232
+ DECLARE_BOOL_CONVERTER (3 ) \
2233
+ DECLARE_BOOL_CONVERTER (4 ) \
2234
+ DECLARE_BOOL_CONVERTER (8 ) \
2235
+ DECLARE_BOOL_CONVERTER (16 ) \
2236
+ DECLARE_SCALAR_BOOL_CONVERTER \
2237
+ } // namespace detail
2238
+
2215
2239
DECLARE_VECTOR_CONVERTERS (char )
2216
2240
DECLARE_SCHAR_VECTOR_CONVERTERS
2241
+ DECLARE_BOOL_VECTOR_CONVERTERS
2217
2242
DECLARE_UNSIGNED_INTEGRAL_VECTOR_CONVERTERS (uchar)
2218
2243
DECLARE_SIGNED_INTEGRAL_VECTOR_CONVERTERS (short )
2219
2244
DECLARE_UNSIGNED_INTEGRAL_VECTOR_CONVERTERS (ushort)
@@ -2236,6 +2261,9 @@ DECLARE_FLOAT_VECTOR_CONVERTERS(double)
2236
2261
#undef DECLARE_SCHAR_VECTOR_CONVERTERS
2237
2262
#undef DECLARE_SCHAR_CONVERTER
2238
2263
#undef DECLARE_SCALAR_SCHAR_CONVERTER
2264
+ #undef DECLARE_BOOL_VECTOR_CONVERTERS
2265
+ #undef DECLARE_BOOL_CONVERTER
2266
+ #undef DECLARE_SCALAR_BOOL_CONVERTER
2239
2267
2240
2268
} // namespace sycl
2241
2269
} // __SYCL_INLINE_NAMESPACE(cl)
0 commit comments