Skip to content

Commit c51f1a6

Browse files
[SYCL][NFC] Use SYCL 2020 cl_* aliases (#8422)
1 parent 6436627 commit c51f1a6

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

sycl/include/sycl/types.hpp

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ template <typename T, int N, typename V = void> struct VecStorage;
128128
// Element type for relational operator return value.
129129
template <typename DataT>
130130
using rel_t = typename detail::conditional_t<
131-
sizeof(DataT) == sizeof(cl_char), cl_char,
131+
sizeof(DataT) == sizeof(opencl::cl_char), opencl::cl_char,
132132
typename detail::conditional_t<
133-
sizeof(DataT) == sizeof(cl_short), cl_short,
133+
sizeof(DataT) == sizeof(opencl::cl_short), opencl::cl_short,
134134
typename detail::conditional_t<
135-
sizeof(DataT) == sizeof(cl_int), cl_int,
136-
typename detail::conditional_t<sizeof(DataT) == sizeof(cl_long),
137-
cl_long, bool>>>>;
135+
sizeof(DataT) == sizeof(opencl::cl_int), opencl::cl_int,
136+
typename detail::conditional_t<sizeof(DataT) ==
137+
sizeof(opencl::cl_long),
138+
opencl::cl_long, bool>>>>;
138139

139140
// Special type indicating that SwizzleOp should just read value from vector -
140141
// not trying to perform any operations. Should not be called.
@@ -349,12 +350,13 @@ convertImpl(T Value) {
349350
#define __SYCL_GENERATE_CONVERT_IMPL(DestType) \
350351
template <typename T, typename R, rounding_mode roundingMode, \
351352
typename OpenCLT, typename OpenCLR> \
352-
detail::enable_if_t<is_sint_to_sint<T, R>::value && \
353-
!std::is_same<OpenCLT, OpenCLR>::value && \
354-
(std::is_same<OpenCLR, cl_##DestType>::value || \
355-
(std::is_same<OpenCLR, signed char>::value && \
356-
std::is_same<DestType, char>::value)), \
357-
R> \
353+
detail::enable_if_t< \
354+
is_sint_to_sint<T, R>::value && \
355+
!std::is_same<OpenCLT, OpenCLR>::value && \
356+
(std::is_same<OpenCLR, opencl::cl_##DestType>::value || \
357+
(std::is_same<OpenCLR, signed char>::value && \
358+
std::is_same<DestType, char>::value)), \
359+
R> \
358360
convertImpl(T Value) { \
359361
OpenCLT OpValue = sycl::detail::convertDataToType<T, OpenCLT>(Value); \
360362
return __spirv_SConvert##_R##DestType(OpValue); \
@@ -373,7 +375,7 @@ __SYCL_GENERATE_CONVERT_IMPL(long)
373375
typename OpenCLT, typename OpenCLR> \
374376
detail::enable_if_t<is_uint_to_uint<T, R>::value && \
375377
!std::is_same<OpenCLT, OpenCLR>::value && \
376-
std::is_same<OpenCLR, cl_##DestType>::value, \
378+
std::is_same<OpenCLR, opencl::cl_##DestType>::value, \
377379
R> \
378380
convertImpl(T Value) { \
379381
OpenCLT OpValue = sycl::detail::convertDataToType<T, OpenCLT>(Value); \
@@ -474,12 +476,13 @@ __SYCL_GENERATE_CONVERT_IMPL_FOR_ROUNDING_MODE(rtn, Rtn)
474476
RoundingModeCondition) \
475477
template <typename T, typename R, rounding_mode roundingMode, \
476478
typename OpenCLT, typename OpenCLR> \
477-
detail::enable_if_t<is_float_to_int<T, R>::value && \
478-
(std::is_same<OpenCLR, cl_##DestType>::value || \
479-
(std::is_same<OpenCLR, signed char>::value && \
480-
std::is_same<DestType, char>::value)) && \
481-
RoundingModeCondition<roundingMode>::value, \
482-
R> \
479+
detail::enable_if_t< \
480+
is_float_to_int<T, R>::value && \
481+
(std::is_same<OpenCLR, opencl::cl_##DestType>::value || \
482+
(std::is_same<OpenCLR, signed char>::value && \
483+
std::is_same<DestType, char>::value)) && \
484+
RoundingModeCondition<roundingMode>::value, \
485+
R> \
483486
convertImpl(T Value) { \
484487
OpenCLT OpValue = sycl::detail::convertDataToType<T, OpenCLT>(Value); \
485488
return __spirv_Convert##SPIRVOp##_R##DestType##_##RoundingMode(OpValue); \

0 commit comments

Comments
 (0)