DPC++ Runtime
Runtime libraries for oneAPI DPC++
generic_type_traits.hpp
Go to the documentation of this file.
1 //==----------- generic_type_traits - SYCL type traits ---------------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
12 #include <CL/sycl/aliases.hpp>
16 #include <CL/sycl/half_type.hpp>
17 
18 #include <limits>
19 
21 namespace sycl {
22 namespace detail {
23 
24 template <typename T> using is_floatn = is_contained<T, gtl::vector_float_list>;
25 
26 template <typename T> using is_genfloatf = is_contained<T, gtl::float_list>;
27 
28 template <typename T>
30 
31 template <typename T> using is_genfloatd = is_contained<T, gtl::double_list>;
32 
33 template <typename T> using is_halfn = is_contained<T, gtl::vector_half_list>;
34 
35 template <typename T> using is_genfloath = is_contained<T, gtl::half_list>;
36 
37 template <typename T> using is_genfloat = is_contained<T, gtl::floating_list>;
38 
39 template <typename T>
41 
42 template <typename T>
44 
45 template <typename T>
47 
48 template <typename T>
50 
51 template <typename T> using is_gengeohalf = is_contained<T, gtl::geo_half_list>;
52 
53 template <typename T>
55 
56 template <typename T>
58 
59 template <typename T>
61 
62 template <typename T> using is_sgengeo = is_contained<T, gtl::scalar_geo_list>;
63 
64 template <typename T> using is_vgengeo = is_contained<T, gtl::vector_geo_list>;
65 
66 template <typename T>
68 
69 template <typename T>
71 
72 template <typename T>
74 
75 template <typename T>
77 
78 template <typename T>
80 
81 template <typename T>
83 
84 template <typename T>
86 
87 template <typename T>
89 
90 template <typename T>
92 
93 template <typename T> using is_genchar = is_contained<T, gtl::char_list>;
94 
95 template <typename T>
97 
98 template <typename T>
100 
101 template <typename T>
103 
104 template <typename T>
106 
107 template <typename T>
109 
110 template <typename T>
112 
113 template <typename T>
115 
116 template <typename T> using is_genint = is_contained<T, gtl::signed_int_list>;
117 
118 template <typename T>
120 
121 template <typename T>
123 
124 template <typename T>
126 
128 
129 template <typename T>
131 
132 template <typename T>
134 
135 template <typename T>
137 
138 template <typename T>
140 
141 template <typename T>
143 
144 template <typename T>
146 
147 template <typename T> using is_geninteger = is_contained<T, gtl::integer_list>;
148 
149 template <typename T>
151 
152 template <typename T>
154 
155 template <typename T>
157 
158 template <typename T>
160 
161 template <typename T>
163 
164 template <typename T>
166 
167 template <typename T>
169 
170 template <typename T>
172 
173 template <typename T> using is_gentype = is_contained<T, gtl::basic_list>;
174 
175 template <typename T>
177 
178 template <typename T>
180 
181 template <typename T>
183 
184 template <typename T>
186 
187 template <typename T>
189 
190 template <typename T>
192 
193 template <typename T>
195 
196 template <typename T>
198 
199 template <typename T>
201 
202 template <typename T>
204 
205 template <typename T>
207 
208 template <typename T>
210 
211 template <typename T>
213 
214 template <typename T>
216 
217 template <typename T>
221 
222 template <typename T>
226 
227 template <typename T>
228 using is_genptr = bool_constant<
231 
232 template <typename T> using is_nan_type = is_contained<T, gtl::nan_list>;
233 
234 // nan_types
235 template <typename T, typename Enable = void> struct nan_types;
236 
237 template <typename T>
238 struct nan_types<
239  T, enable_if_t<is_contained<T, gtl::unsigned_short_list>::value, T>> {
242 };
243 
244 template <typename T>
245 struct nan_types<
246  T, enable_if_t<is_contained<T, gtl::unsigned_int_list>::value, T>> {
249 };
250 
251 template <typename T>
252 struct nan_types<
253  T,
256  using arg_type =
258 };
259 
260 template <typename T> using nan_return_t = typename nan_types<T, T>::ret_type;
261 
262 template <typename T>
264 
265 template <typename T>
267 
268 template <typename T>
270 
271 template <typename T>
274 
275 template <typename T, typename B, typename Enable = void>
277 
278 template <typename T, typename B>
279 struct convert_data_type_impl<T, B, enable_if_t<is_sgentype<T>::value, T>> {
280  B operator()(T t) { return static_cast<B>(t); }
281 };
282 
283 template <typename T, typename B>
284 struct convert_data_type_impl<T, B, enable_if_t<is_vgentype<T>::value, T>> {
285  vec<B, T::size()> operator()(T t) { return t.template convert<B>(); }
286 };
287 
288 template <typename T, typename B>
290 
291 // Try to get pointer_t, otherwise T
292 template <typename T> class TryToGetPointerT {
293  static T check(...);
294  template <typename A> static typename A::pointer_t check(const A &);
295 
296 public:
297  using type = decltype(check(T()));
298  static constexpr bool value =
299  std::is_pointer<T>::value || !std::is_same<T, type>::value;
300 };
301 
302 // Try to get element_type, otherwise T
303 template <typename T> class TryToGetElementType {
304  static T check(...);
305  template <typename A> static typename A::element_type check(const A &);
306 
307 public:
308  using type = decltype(check(T()));
309  static constexpr bool value = !std::is_same<T, type>::value;
310 };
311 
312 // Try to get vector_t, otherwise T
313 template <typename T> class TryToGetVectorT {
314  static T check(...);
315  template <typename A> static typename A::vector_t check(const A &);
316 
317 public:
318  using type = decltype(check(T()));
319  static constexpr bool value = !std::is_same<T, type>::value;
320 };
321 
322 // Try to get pointer_t (if pointer_t indicates on the type with_remainder
323 // vector_t creates a pointer type on vector_t), otherwise T
324 template <typename T> class TryToGetPointerVecT {
325  static T check(...);
326  template <typename A>
327  static typename DecoratedType<
330  check(const A &);
331  template <typename A>
332  static typename TryToGetVectorT<A>::type *check(const A *);
333 
334 public:
335  using type = decltype(check(T()));
336 };
337 
338 template <typename T, typename = typename detail::enable_if_t<
339  TryToGetPointerT<T>::value, std::true_type>>
341  // TODO find the better way to get the pointer to underlying data from vec
342  // class
343  return reinterpret_cast<typename TryToGetPointerVecT<T>::type>(t.get());
344 }
345 
346 template <typename T>
348  // TODO find the better way to get the pointer to underlying data from vec
349  // class
350  return reinterpret_cast<typename TryToGetPointerVecT<T *>::type>(t);
351 }
352 
353 template <typename T, typename = typename detail::enable_if_t<
354  !TryToGetPointerT<T>::value, std::false_type>>
356  return t;
357 }
358 
359 // select_apply_cl_scalar_t selects from T8/T16/T32/T64 basing on
360 // sizeof(IN). expected to handle scalar types.
361 template <typename T, typename T8, typename T16, typename T32, typename T64>
363  conditional_t<sizeof(T) == 1, T8,
364  conditional_t<sizeof(T) == 2, T16,
365  conditional_t<sizeof(T) == 4, T32, T64>>>;
366 
367 // Shortcuts for selecting scalar int/unsigned int/fp type.
368 template <typename T>
372 
373 template <typename T>
377 
378 template <typename T>
382 
383 template <typename T>
388 
389 // select_cl_scalar_t picks corresponding cl_* type for input
390 // scalar T or returns T if T is not scalar.
391 template <typename T>
393  std::is_integral<T>::value, select_cl_scalar_integral_t<T>,
395  std::is_floating_point<T>::value, select_cl_scalar_float_t<T>,
396  // half is a special case: it is implemented differently on host and
397  // device and therefore, might lower to different types
400 
401 // select_cl_vector_or_scalar does cl_* type selection for element type of
402 // a vector type T and does scalar type substitution. If T is not
403 // vector or scalar unmodified T is returned.
404 template <typename T, typename Enable = void> struct select_cl_vector_or_scalar;
405 
406 template <typename T>
408  T, typename detail::enable_if_t<is_vgentype<T>::value>> {
409  using type =
410  // select_cl_scalar_t returns _Float16, so, we try to instantiate vec
411  // class with _Float16 DataType, which is not expected there
412  // So, leave vector<half, N> as-is
414  typename T::element_type,
416  T::size()>;
417 };
418 
419 template <typename T>
421  T, typename detail::enable_if_t<!is_vgentype<T>::value>> {
423 };
424 
425 // select_cl_mptr_or_vector_or_scalar does cl_* type selection for type
426 // pointed by multi_ptr or for element type of a vector type T and does
427 // scalar type substitution. If T is not mutlti_ptr or vector or scalar
428 // unmodified T is returned.
429 template <typename T, typename Enable = void>
431 
432 // this struct helps to use std::uint8_t instead of std::byte,
433 // which is not supported on device
434 template <typename T> struct TypeHelper { using RetType = T; };
435 
436 #if __cplusplus >= 201703L && (!defined(_HAS_STD_BYTE) || _HAS_STD_BYTE != 0)
437 template <> struct TypeHelper<std::byte> { using RetType = std::uint8_t; };
438 #endif
439 
440 template <typename T> using type_helper = typename TypeHelper<T>::RetType;
441 
442 template <typename T>
444  T, typename detail::enable_if_t<is_genptr<T>::value &&
445  !std::is_pointer<T>::value>> {
446  using type = multi_ptr<typename select_cl_vector_or_scalar<
449 };
450 
451 template <typename T>
453  T, typename detail::enable_if_t<!is_genptr<T>::value ||
454  std::is_pointer<T>::value>> {
456 };
457 
458 // All types converting shortcut.
459 template <typename T>
462 
463 // Converts T to OpenCL friendly
464 //
465 template <typename T>
473 
474 // convertDataToType() function converts data from FROM type to TO type using
475 // 'as' method for vector type and copy otherwise.
476 template <typename FROM, typename TO>
479  sizeof(TO) == sizeof(FROM),
480  TO>
482  return t.template as<TO>();
483 }
484 
485 template <typename FROM, typename TO>
488  sizeof(TO) == sizeof(FROM),
489  TO>
491  return TryToGetPointer(t);
492 }
493 
494 // Used for all, any and select relational built-in functions
495 template <typename T> inline constexpr T msbMask(T) {
496  using UT = make_unsigned_t<T>;
497  return T(UT(1) << (sizeof(T) * 8 - 1));
498 }
499 
500 template <typename T> inline constexpr bool msbIsSet(const T x) {
501  return (x & msbMask(x));
502 }
503 
504 template <typename T>
505 using common_rel_ret_t =
507 
508 // forward declaration
509 template <int N> struct Boolean;
510 
511 // Try to get vector element count or 1 otherwise
512 template <typename T, typename Enable = void> struct TryToGetNumElements;
513 
514 template <typename T>
516  T, typename detail::enable_if_t<TryToGetVectorT<T>::value>> {
517  static constexpr int value = T::size();
518 };
519 template <typename T>
521  T, typename detail::enable_if_t<!TryToGetVectorT<T>::value>> {
522  static constexpr int value = 1;
523 };
524 
525 // Used for relational comparison built-in functions
526 template <typename T> struct RelationalReturnType {
527 #ifdef __SYCL_DEVICE_ONLY__
529 #else
531 #endif
532 };
533 
534 template <typename T> using rel_ret_t = typename RelationalReturnType<T>::type;
535 
536 // Used for any and all built-in functions
537 template <typename T> struct RelationalTestForSignBitType {
538 #ifdef __SYCL_DEVICE_ONLY__
541 #else
542  using return_type = int;
543  using argument_type = T;
544 #endif
545 };
546 
547 template <typename T>
550 
551 template <typename T>
554 
555 template <typename T, typename Enable = void> struct RelConverter;
556 
557 template <typename T>
559  T, typename detail::enable_if_t<TryToGetElementType<T>::value>> {
560  static const int N = T::size();
561 #ifdef __SYCL_DEVICE_ONLY__
562  using bool_t = typename Boolean<N>::vector_t;
563  using ret_t = common_rel_ret_t<T>;
564 #else
567 #endif
568 
569  static ret_t apply(bool_t value) {
570 #ifdef __SYCL_DEVICE_ONLY__
571  typename ret_t::vector_t result(0);
572  for (size_t I = 0; I < N; ++I) {
573  result[I] = value[I];
574  }
575  return result;
576 #else
577  return value;
578 #endif
579  }
580 };
581 
582 template <typename T>
584  T, typename detail::enable_if_t<!TryToGetElementType<T>::value>> {
585  using R = rel_ret_t<T>;
586 #ifdef __SYCL_DEVICE_ONLY__
587  using value_t = bool;
588 #else
589  using value_t = R;
590 #endif
591 
592  static R apply(value_t value) { return value; }
593 };
594 
595 template <typename T> static constexpr T max_v() {
596  return (std::numeric_limits<T>::max)();
597 }
598 
599 template <typename T> static constexpr T min_v() {
600  return (std::numeric_limits<T>::min)();
601 }
602 
603 template <typename T> static constexpr T quiet_NaN() {
605 }
606 
607 // is_same_vector_size
608 template <int FirstSize, typename... Args> class is_same_vector_size_impl;
609 
610 template <int FirstSize, typename T, typename... Args>
611 class is_same_vector_size_impl<FirstSize, T, Args...> {
612  using CurrentT = detail::remove_pointer_t<T>;
613  static constexpr int Size = vector_size<CurrentT>::value;
614  static constexpr bool IsSizeEqual = (Size == FirstSize);
615 
616 public:
617  static constexpr bool value =
618  IsSizeEqual ? is_same_vector_size_impl<FirstSize, Args...>::value : false;
619 };
620 
621 template <int FirstSize>
622 class is_same_vector_size_impl<FirstSize> : public std::true_type {};
623 
624 template <typename T, typename... Args> class is_same_vector_size {
625  using CurrentT = remove_pointer_t<T>;
626  static constexpr int Size = vector_size<CurrentT>::value;
627 
628 public:
629  static constexpr bool value = is_same_vector_size_impl<Size, Args...>::value;
630 };
631 
632 // check_vector_size
633 template <typename... Args> inline void check_vector_size() {
635  "The built-in function arguments must [point to|have] types "
636  "with the same number of elements.");
637 }
638 
639 } // namespace detail
640 } // namespace sycl
641 } // __SYCL_INLINE_NAMESPACE(cl)
cl::sycl::detail::make_unsinged_integer_t
make_type_t< T, gtl::scalar_unsigned_integer_list > make_unsinged_integer_t
Definition: generic_type_traits.hpp:273
cl::sycl::detail::RelationalTestForSignBitType::return_type
int return_type
Definition: generic_type_traits.hpp:542
cl::sycl::cl_double
double cl_double
Definition: aliases.hpp:88
cl::sycl::cl_half
half cl_half
Definition: aliases.hpp:86
cl::sycl::cl_uchar
std::uint8_t cl_uchar
Definition: aliases.hpp:79
cl::sycl::cl_long
std::int64_t cl_long
Definition: aliases.hpp:84
cl::sycl::detail::TryToGetVectorT
Definition: generic_type_traits.hpp:313
type_traits.hpp
cl::sycl::detail::select_cl_scalar_float_t
select_apply_cl_scalar_t< T, std::false_type, sycl::cl_half, sycl::cl_float, sycl::cl_double > select_cl_scalar_float_t
Definition: generic_type_traits.hpp:381
cl::sycl::detail::min_v
static constexpr T min_v()
Definition: generic_type_traits.hpp:599
cl::sycl::detail::RelationalReturnType::type
common_rel_ret_t< T > type
Definition: generic_type_traits.hpp:530
cl::sycl::detail::msbMask
constexpr T msbMask(T)
Definition: generic_type_traits.hpp:495
cl::sycl::detail::nan_return_t
typename nan_types< T, T >::ret_type nan_return_t
Definition: generic_type_traits.hpp:260
cl::sycl::detail::msbIsSet
constexpr bool msbIsSet(const T x)
Definition: generic_type_traits.hpp:500
cl::sycl::detail::SelectMatchingOpenCLType_t
typename select_cl_mptr_or_vector_or_scalar< T >::type SelectMatchingOpenCLType_t
Definition: generic_type_traits.hpp:461
cl::sycl::detail::is_geninteger32bit
is_gen_based_on_type_sizeof< T, 4, is_geninteger > is_geninteger32bit
Definition: generic_type_traits.hpp:212
cl::sycl::detail::is_same_vector_size_impl
Definition: generic_type_traits.hpp:608
cl::sycl::detail::TryToGetNumElements
Definition: generic_type_traits.hpp:512
cl::sycl::detail::check_vector_size
void check_vector_size()
Definition: generic_type_traits.hpp:633
cl::sycl::detail::RelConverter< T, typename detail::enable_if_t<!TryToGetElementType< T >::value > >::apply
static R apply(value_t value)
Definition: generic_type_traits.hpp:592
cl::sycl::detail::gtl::unsigned_long_integer_list
type_list< scalar_unsigned_long_integer_list, vector_unsigned_long_integer_list, marray_unsigned_long_integer_list > unsigned_long_integer_list
Definition: generic_type_lists.hpp:388
cl::sycl::detail::rel_sign_bit_test_ret_t
typename RelationalTestForSignBitType< T >::return_type rel_sign_bit_test_ret_t
Definition: generic_type_traits.hpp:549
cl::sycl::detail::is_contained
Definition: type_list.hpp:54
cl::sycl::detail::TryToGetElementType
Definition: generic_type_traits.hpp:303
cl::sycl::detail::make_unsigned_t
typename make_unsigned< T >::type make_unsigned_t
Definition: type_traits.hpp:201
cl::sycl::detail::half_impl::BIsRepresentationT
half BIsRepresentationT
Definition: half_type.hpp:304
cl::sycl::detail::nan_types< T, enable_if_t< is_contained< T, gtl::unsigned_short_list >::value, T > >::arg_type
find_same_size_type_t< gtl::scalar_unsigned_short_list, half > arg_type
Definition: generic_type_traits.hpp:241
cl::sycl::detail::select_cl_scalar_integral_signed_t
select_apply_cl_scalar_t< T, sycl::cl_char, sycl::cl_short, sycl::cl_int, sycl::cl_long > select_cl_scalar_integral_signed_t
Definition: generic_type_traits.hpp:371
cl::sycl::detail::convert_data_type_impl
Definition: generic_type_traits.hpp:276
cl::sycl::detail::remove_pointer_t
typename remove_pointer< T >::type remove_pointer_t
Definition: type_traits.hpp:275
cl::sycl::detail::select_cl_vector_or_scalar< T, typename detail::enable_if_t<!is_vgentype< T >::value > >::type
select_cl_scalar_t< T > type
Definition: generic_type_traits.hpp:422
sycl
Definition: invoke_simd.hpp:68
cl::sycl::detail::nan_types< T, enable_if_t< is_contained< T, gtl::unsigned_short_list >::value, T > >::ret_type
change_base_type_t< T, half > ret_type
Definition: generic_type_traits.hpp:240
bool_constant
cl::sycl::multi_ptr
Provides constructors for address space qualified and non address space qualified pointers to allow i...
Definition: atomic.hpp:32
max
simd< _Tp, _Abi > max(const simd< _Tp, _Abi > &, const simd< _Tp, _Abi > &) noexcept
cl::sycl::detail::is_ugeninteger8bit
is_gen_based_on_type_sizeof< T, 1, is_ugeninteger > is_ugeninteger8bit
Definition: generic_type_traits.hpp:194
access.hpp
cl::sycl::detail::select_cl_scalar_t
conditional_t< std::is_integral< T >::value, select_cl_scalar_integral_t< T >, conditional_t< std::is_floating_point< T >::value, select_cl_scalar_float_t< T >, conditional_t< std::is_same< T, half >::value, cl::sycl::detail::half_impl::BIsRepresentationT, T > >> select_cl_scalar_t
Definition: generic_type_traits.hpp:399
cl::sycl::detail::select_cl_vector_or_scalar
Definition: generic_type_traits.hpp:404
cl::sycl::detail::type_helper
typename TypeHelper< T >::RetType type_helper
Definition: generic_type_traits.hpp:440
cl::sycl::detail::is_geninteger16bit
is_gen_based_on_type_sizeof< T, 2, is_geninteger > is_geninteger16bit
Definition: generic_type_traits.hpp:209
cl::sycl::detail::RelConverter< T, typename detail::enable_if_t< TryToGetElementType< T >::value > >::ret_t
rel_ret_t< T > ret_t
Definition: generic_type_traits.hpp:566
generic_type_lists.hpp
cl::sycl::detail::is_ugeninteger32bit
is_gen_based_on_type_sizeof< T, 4, is_ugeninteger > is_ugeninteger32bit
Definition: generic_type_traits.hpp:200
cl::sycl::detail::find_same_size_type_t
find_type_t< TL, is_type_size_equal, T > find_same_size_type_t
Definition: type_list.hpp:122
cl::sycl::detail::select_cl_mptr_or_vector_or_scalar
Definition: generic_type_traits.hpp:430
cl::sycl::detail::TryToGetElementType::type
decltype(check(T())) type
Definition: generic_type_traits.hpp:308
cl::sycl::detail::is_genfloatptr
bool_constant< is_pointer< T >::value &&is_genfloat< remove_pointer_t< T > >::value &&is_address_space_compliant< T, gvl::nonconst_address_space_list >::value > is_genfloatptr
Definition: generic_type_traits.hpp:225
cl::sycl::detail::is_igeninteger16bit
is_gen_based_on_type_sizeof< T, 2, is_igeninteger > is_igeninteger16bit
Definition: generic_type_traits.hpp:185
cl::sycl::detail::ConvertToOpenCLType_t
conditional_t< TryToGetVectorT< SelectMatchingOpenCLType_t< T > >::value, typename TryToGetVectorT< SelectMatchingOpenCLType_t< T > >::type, conditional_t< TryToGetPointerT< SelectMatchingOpenCLType_t< T > >::value, typename TryToGetPointerVecT< SelectMatchingOpenCLType_t< T > >::type, SelectMatchingOpenCLType_t< T > >> ConvertToOpenCLType_t
Definition: generic_type_traits.hpp:472
cl::sycl::detail::is_igeninteger8bit
is_gen_based_on_type_sizeof< T, 1, is_igeninteger > is_igeninteger8bit
Definition: generic_type_traits.hpp:182
cl::sycl::detail::Boolean< 1 >
Definition: boolean.hpp:103
cl::sycl::detail::quiet_NaN
static constexpr T quiet_NaN()
Definition: generic_type_traits.hpp:603
cl::sycl::detail::RelationalReturnType
Definition: generic_type_traits.hpp:526
cl::sycl::detail::is_geninteger8bit
is_gen_based_on_type_sizeof< T, 1, is_geninteger > is_geninteger8bit
Definition: generic_type_traits.hpp:206
cl::sycl::detail::conditional_t
typename std::conditional< B, T, F >::type conditional_t
Definition: stl_type_traits.hpp:27
cl::sycl::detail::select_cl_scalar_integral_t
conditional_t< std::is_signed< T >::value, select_cl_scalar_integral_signed_t< T >, select_cl_scalar_integral_unsigned_t< T > > select_cl_scalar_integral_t
Definition: generic_type_traits.hpp:387
cl::sycl::detail::make_floating_point_t
make_type_t< T, gtl::scalar_floating_list > make_floating_point_t
Definition: generic_type_traits.hpp:266
cl::sycl::cl_ushort
std::uint16_t cl_ushort
Definition: aliases.hpp:81
cl::sycl::detail::is_address_space_compliant
Definition: type_traits.hpp:289
cl::sycl::detail::TryToGetPointerVecT
Definition: generic_type_traits.hpp:324
cl::sycl::detail::is_pointer
Definition: type_traits.hpp:260
cl::sycl::detail::RelationalTestForSignBitType
Definition: generic_type_traits.hpp:537
cl::sycl::detail::TryToGetPointer
T TryToGetPointer(T &t)
Definition: generic_type_traits.hpp:355
cl::sycl::byte
unsigned char byte
Definition: image.hpp:59
cl::sycl::detail::gtl::unsigned_int_list
type_list< scalar_unsigned_int_list, vector_unsigned_int_list, marray_unsigned_int_list > unsigned_int_list
Definition: generic_type_lists.hpp:261
cl::sycl::detail::RelationalTestForSignBitType::argument_type
T argument_type
Definition: generic_type_traits.hpp:543
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::cl_char
std::int8_t cl_char
Definition: aliases.hpp:78
cl::sycl::detail::common_rel_ret_t
conditional_t< is_vgentype< T >::value, make_singed_integer_t< T >, int > common_rel_ret_t
Definition: generic_type_traits.hpp:506
cl::sycl::detail::convertDataToType
detail::enable_if_t<!(is_vgentype< FROM >::value &&is_vgentype< TO >::value) &&sizeof(TO)==sizeof(FROM), TO > convertDataToType(FROM t)
Definition: generic_type_traits.hpp:490
cl::sycl::detail::select_cl_mptr_or_vector_or_scalar< T, typename detail::enable_if_t<!is_genptr< T >::value||std::is_pointer< T >::value > >::type
typename select_cl_vector_or_scalar< T >::type type
Definition: generic_type_traits.hpp:455
cl::sycl::detail::max_v
static constexpr T max_v()
Definition: generic_type_traits.hpp:595
cl::sycl::detail::is_genptr
bool_constant< is_pointer< T >::value &&is_gentype< remove_pointer_t< T > >::value &&is_address_space_compliant< T, gvl::nonconst_address_space_list >::value > is_genptr
Definition: generic_type_traits.hpp:230
cl::sycl::detail::is_same_vector_size
Definition: generic_type_traits.hpp:624
cl::sycl::detail::nan_argument_base_t
typename nan_types< T, T >::arg_type nan_argument_base_t
Definition: generic_type_traits.hpp:263
cl::sycl::cl_ulong
std::uint64_t cl_ulong
Definition: aliases.hpp:85
cl::sycl::detail::RelConverter< T, typename detail::enable_if_t<!TryToGetElementType< T >::value > >::R
rel_ret_t< T > R
Definition: generic_type_traits.hpp:585
cl::sycl::cl_float
float cl_float
Definition: aliases.hpp:87
cl::sycl::detail::is_igeninteger32bit
is_gen_based_on_type_sizeof< T, 4, is_igeninteger > is_igeninteger32bit
Definition: generic_type_traits.hpp:188
cl::sycl::access::address_space
address_space
Definition: access.hpp:45
cl::sycl::detail::nan_types< T, enable_if_t< is_contained< T, gtl::unsigned_int_list >::value, T > >::ret_type
change_base_type_t< T, float > ret_type
Definition: generic_type_traits.hpp:247
cl::sycl::detail::change_base_type_t
typename change_base_type< T, B >::type change_base_type_t
Definition: type_traits.hpp:110
cl::sycl::detail::TryToGetPointerT
Definition: generic_type_traits.hpp:292
cl::sycl::detail::is_ugeninteger16bit
is_gen_based_on_type_sizeof< T, 2, is_ugeninteger > is_ugeninteger16bit
Definition: generic_type_traits.hpp:197
cl::sycl::detail::RelConverter
Definition: generic_type_traits.hpp:555
cl::sycl::detail::TypeHelper::RetType
T RetType
Definition: generic_type_traits.hpp:434
cl::sycl::detail::convert_data_type_impl< T, B, enable_if_t< is_vgentype< T >::value, T > >::operator()
vec< B, T::size()> operator()(T t)
Definition: generic_type_traits.hpp:285
cl::sycl::vec
Provides a cross-patform vector class template that works efficiently on SYCL devices as well as in h...
Definition: aliases.hpp:18
cl::sycl::cl_int
std::int32_t cl_int
Definition: aliases.hpp:82
cl::sycl::detail::TryToGetVectorT::type
decltype(check(T())) type
Definition: generic_type_traits.hpp:318
std
Definition: accessor.hpp:2616
cl::sycl::detail::rel_ret_t
typename RelationalReturnType< T >::type rel_ret_t
Definition: generic_type_traits.hpp:534
cl::sycl::detail::TypeHelper
Definition: generic_type_traits.hpp:434
half_type.hpp
aliases.hpp
cl::sycl::detail::nan_types< T, enable_if_t< is_contained< T, gtl::unsigned_int_list >::value, T > >::arg_type
find_same_size_type_t< gtl::scalar_unsigned_int_list, float > arg_type
Definition: generic_type_traits.hpp:248
cl::sycl::cl_uint
std::uint32_t cl_uint
Definition: aliases.hpp:83
cl::sycl::detail::is_ugeninteger64bit
is_gen_based_on_type_sizeof< T, 8, is_ugeninteger > is_ugeninteger64bit
Definition: generic_type_traits.hpp:203
cl::sycl::detail::TryToGetPointerT::type
decltype(check(T())) type
Definition: generic_type_traits.hpp:297
cl::sycl::detail::RelConverter< T, typename detail::enable_if_t<!TryToGetElementType< T >::value > >::value_t
R value_t
Definition: generic_type_traits.hpp:589
common.hpp
cl::sycl::detail::gtl::unsigned_short_list
type_list< scalar_unsigned_short_list, vector_unsigned_short_list, marray_unsigned_short_list > unsigned_short_list
Definition: generic_type_lists.hpp:220
cl::sycl::cl_short
std::int16_t cl_short
Definition: aliases.hpp:80
cl::sycl::detail::select_apply_cl_scalar_t
conditional_t< sizeof(T)==1, T8, conditional_t< sizeof(T)==2, T16, conditional_t< sizeof(T)==4, T32, T64 > >> select_apply_cl_scalar_t
Definition: generic_type_traits.hpp:365
cl::sycl::detail::is_gen_based_on_type_sizeof
bool_constant< S< T >::value &&(sizeof(vector_element_t< T >)==N)> is_gen_based_on_type_sizeof
Definition: type_traits.hpp:206
cl::sycl::detail::TryToGetPointerVecT::type
decltype(check(T())) type
Definition: generic_type_traits.hpp:335
cl::sycl::detail::enable_if_t
typename std::enable_if< B, T >::type enable_if_t
Definition: stl_type_traits.hpp:24
cl::sycl::detail::make_type_t
typename make_type_impl< T, TL >::type make_type_t
Definition: type_traits.hpp:303
cl::sycl::detail::nan_types< T, enable_if_t< is_contained< T, gtl::unsigned_long_integer_list >::value, T > >::arg_type
find_same_size_type_t< gtl::scalar_unsigned_long_integer_list, double > arg_type
Definition: generic_type_traits.hpp:257
cl::sycl::detail::is_igeninteger64bit
is_gen_based_on_type_sizeof< T, 8, is_igeninteger > is_igeninteger64bit
Definition: generic_type_traits.hpp:191
cl::sycl::detail::is_geninteger64bit
is_gen_based_on_type_sizeof< T, 8, is_geninteger > is_geninteger64bit
Definition: generic_type_traits.hpp:215
cl::sycl::detail::select_cl_scalar_integral_unsigned_t
select_apply_cl_scalar_t< T, sycl::cl_uchar, sycl::cl_ushort, sycl::cl_uint, sycl::cl_ulong > select_cl_scalar_integral_unsigned_t
Definition: generic_type_traits.hpp:376
cl::sycl::detail::make_singed_integer_t
make_type_t< T, gtl::scalar_signed_integer_list > make_singed_integer_t
Definition: generic_type_traits.hpp:269
cl::sycl::detail::Boolean
Definition: boolean.hpp:46
cl::sycl::detail::vector_size
Definition: type_traits.hpp:77
cl::sycl::detail::RelConverter< T, typename detail::enable_if_t< TryToGetElementType< T >::value > >::apply
static ret_t apply(bool_t value)
Definition: generic_type_traits.hpp:569
cl::sycl::detail::is_genintptr
bool_constant< is_pointer< T >::value &&is_genint< remove_pointer_t< T > >::value &&is_address_space_compliant< T, gvl::nonconst_address_space_list >::value > is_genintptr
Definition: generic_type_traits.hpp:220
cl::sycl::detail::convert_data_type_impl< T, B, enable_if_t< is_sgentype< T >::value, T > >::operator()
B operator()(T t)
Definition: generic_type_traits.hpp:280
cl::sycl::detail::nan_types< T, enable_if_t< is_contained< T, gtl::unsigned_long_integer_list >::value, T > >::ret_type
change_base_type_t< T, double > ret_type
Definition: generic_type_traits.hpp:255
min
simd< _Tp, _Abi > min(const simd< _Tp, _Abi > &, const simd< _Tp, _Abi > &) noexcept
cl::sycl::detail::DecoratedType
Definition: access.hpp:159
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12
cl::sycl::detail::nan_types
Definition: generic_type_traits.hpp:235
cl::sycl::detail::rel_sign_bit_test_arg_t
typename RelationalTestForSignBitType< T >::argument_type rel_sign_bit_test_arg_t
Definition: generic_type_traits.hpp:553