11#if defined(__HIPCC_RTC__) || defined(CK_CODE_GEN_RTC)
13#define CK_BUILTIN_TYPE_TRAIT1(name) \
15 struct name : bool_constant<__##name(T)> \
20#define CK_BUILTIN_TYPE_TRAIT2(name) \
21 template <class T, class U> \
22 struct name : bool_constant<__##name(T, U)> \
27#define CK_BUILTIN_TYPE_TRAITN(name) \
28 template <class... Ts> \
29 struct name : bool_constant<__##name(Ts...)> \
33CK_BUILTIN_TYPE_TRAIT1(is_class);
34CK_BUILTIN_TYPE_TRAIT1(is_pointer);
35CK_BUILTIN_TYPE_TRAIT1(is_reference);
36CK_BUILTIN_TYPE_TRAIT1(is_trivially_copyable);
37CK_BUILTIN_TYPE_TRAIT1(is_unsigned);
38CK_BUILTIN_TYPE_TRAIT2(is_base_of);
47struct remove_cv<const T> : remove_cv<T>
52struct remove_cv<volatile T> : remove_cv<T>
57struct remove_reference
62struct remove_reference<T&>
67struct remove_reference<T&&>
77struct remove_pointer<T*>
82struct remove_pointer<T*
const>
87struct remove_pointer<T*
volatile>
92struct remove_pointer<T*
const volatile>
98constexpr T&& forward(
typename remove_reference<T>::type& t_)
noexcept
100 return static_cast<T&&
>(t_);
103constexpr T&& forward(
typename remove_reference<T>::type&& t_)
noexcept
105 return static_cast<T&&
>(t_);
117inline constexpr bool is_const_v = is_const<T>::value;
120inline constexpr bool is_reference_v = is_reference<T>::value;
128struct remove_const<const T>
133using remove_const_t =
typename remove_const<T>::type;
135inline constexpr bool is_class_v = is_class<T>::value;
138inline constexpr bool is_trivially_copyable_v = is_trivially_copyable<T>::value;
142template <
class T,
class U = T&&>
143U private_declval(
int);
146T private_declval(
long);
149auto declval() noexcept -> decltype(private_declval<T>(0));
155#include <type_traits>
158using std::is_base_of;
160using std::is_class_v;
161using std::is_const_v;
162using std::is_pointer;
163using std::is_reference;
164using std::is_reference_v;
165using std::is_trivially_copyable;
166using std::is_trivially_copyable_v;
167using std::is_unsigned;
168using std::remove_const_t;
170using std::remove_pointer;
171using std::remove_reference;
175template <
typename X,
typename Y>
282template <
typename X,
typename Y>
285template <
typename X,
typename Y>
305template <
typename Y,
typename X,
typename enable_if<sizeof(X) == sizeof(Y),
bool>::type = false>
306__host__ __device__
constexpr Y
bit_cast(
const X& x)
308 static_assert(__has_builtin(__builtin_bit_cast),
"");
309 static_assert(
sizeof(X) ==
sizeof(Y),
"Do not support cast between different size of type");
311 return __builtin_bit_cast(Y, x);
remove_cv_t< remove_reference_t< T > > remove_cvref_t
Definition type.hpp:297
constexpr bool is_pointer_v
Definition type.hpp:303
constexpr bool is_base_of_v
Definition type.hpp:286
constexpr bool is_unsigned_v
Definition type.hpp:289
constexpr bool is_same_v
Definition type.hpp:283
typename remove_reference< T >::type remove_reference_t
Definition type.hpp:292
__host__ __device__ constexpr Y bit_cast(const X &x)
Definition type.hpp:306
typename remove_cv< T >::type remove_cv_t
Definition type.hpp:295
typename remove_pointer< T >::type remove_pointer_t
Definition type.hpp:300
static constexpr value_type value
Definition utility/integral_constant.hpp:13
Definition utility/integral_constant.hpp:20