1 | // Generated from "/code/pytorch/third_party/nvfuser/runtime/type_traits.cu" |
2 | // 2023-02-12 08:01:26 |
3 | |
4 | namespace nvfuser_resources { |
5 | |
6 | constexpr const char* type_traits_cu = R"( |
7 | // Type trait utils |
8 | template <typename Type, bool is_volatile> |
9 | struct MaybeVolatile; |
10 | |
11 | template <typename Type> |
12 | struct MaybeVolatile<Type, true> { |
13 | using type = volatile Type; |
14 | }; |
15 | |
16 | template <typename Type> |
17 | struct MaybeVolatile<Type, false> { |
18 | using type = Type; |
19 | }; |
20 | |
21 | template <typename... Types> |
22 | struct TypeList {}; |
23 | |
24 | template <int idx, typename T, typename... Types> |
25 | struct TypeSelector { |
26 | using type = typename TypeSelector<idx - 1, Types...>::type; |
27 | }; |
28 | |
29 | template <typename T, typename... Types> |
30 | struct TypeSelector<0, T, Types...> { |
31 | using type = T; |
32 | }; |
33 | |
34 | template <typename T0, typename T1> |
35 | struct IsSameType { |
36 | static constexpr bool value = false; |
37 | }; |
38 | |
39 | template <typename T0> |
40 | struct IsSameType<T0, T0> { |
41 | static constexpr bool value = true; |
42 | }; |
43 | |
44 | template <typename T> |
45 | struct IsPointerType { |
46 | static constexpr bool value = false; |
47 | }; |
48 | |
49 | template <typename T> |
50 | struct IsPointerType<T*> { |
51 | static constexpr bool value = true; |
52 | }; |
53 | )" ; |
54 | |
55 | } // namespace nvfuser_resources |
56 | |