|
4 | 4 |
|
5 | 5 | using namespace sycl::ext::oneapi::experimental::new_properties;
|
6 | 6 |
|
7 |
| -using mock_property_sort_key_t = int; |
8 |
| - |
9 | 7 | template <typename property_key_t> constexpr auto generate_property_key_name() {
|
10 | 8 | #if defined(__clang__) || defined(__GNUC__)
|
11 | 9 | return __PRETTY_FUNCTION__;
|
@@ -73,69 +71,14 @@ template <int... N> void test(std::integer_sequence<int, N...>) {
|
73 | 71 | }
|
74 | 72 | } // namespace bench
|
75 | 73 |
|
76 |
| -namespace test_group_load_store { |
77 |
| -struct naive : named_property_base<naive> {}; |
78 |
| -struct full_group : named_property_base<full_group> {}; |
79 |
| -constexpr properties pl1{full_group{}}; |
80 |
| -constexpr properties pl2{pl1, naive{}}; |
81 |
| -static_assert(pl1.template has_property<full_group>()); |
82 |
| -static_assert(!pl1.template has_property<naive>()); |
83 |
| -static_assert(pl2.template has_property<full_group>()); |
84 |
| -static_assert(pl2.template has_property<naive>()); |
85 |
| - |
86 |
| -enum class data_placement { blocked, striped }; |
87 |
| -template <data_placement placement> |
88 |
| -struct data_placement_property |
89 |
| - : named_property_base<data_placement_property<placement>, |
90 |
| - struct data_placement_property_key> { |
91 |
| - static constexpr bool is_blocked() { |
92 |
| - return placement == data_placement::blocked; |
93 |
| - } |
94 |
| -}; |
95 |
| -inline constexpr data_placement_property<data_placement::blocked> blocked; |
96 |
| -inline constexpr data_placement_property<data_placement::striped> striped; |
97 |
| - |
98 |
| -static_assert(properties{naive{}, blocked} |
99 |
| - .get_property<struct data_placement_property_key>() |
100 |
| - .is_blocked()); |
101 |
| -static_assert(!properties{naive{}, striped} |
102 |
| - .get_property<struct data_placement_property_key>() |
103 |
| - .is_blocked()); |
104 |
| -static_assert( |
105 |
| - properties{naive{}, blocked} |
106 |
| - .get_property_or_default_to<struct data_placement_property_key>(blocked) |
107 |
| - .is_blocked()); |
108 |
| -static_assert( |
109 |
| - !properties{naive{}, data_placement_property<data_placement::striped>{}} |
110 |
| - .get_property_or_default_to<struct data_placement_property_key>( |
111 |
| - blocked) |
112 |
| - .is_blocked()); |
113 |
| -static_assert( |
114 |
| - properties{naive{}} |
115 |
| - .get_property_or_default_to<struct data_placement_property_key>(blocked) |
116 |
| - .is_blocked()); |
117 |
| -static_assert( |
118 |
| - !properties{naive{}} |
119 |
| - .get_property_or_default_to<struct data_placement_property_key>( |
120 |
| - striped) |
121 |
| - .is_blocked()); |
122 |
| - |
123 |
| -constexpr properties pl3{full_group{}, blocked}; |
124 |
| -// constexpr properties pl4{pl3, naive{}}; |
125 |
| -template <typename... other_property_list_tys, typename... other_property_tys> |
126 |
| -constexpr auto merge_properties( |
127 |
| - properties<detail::properties_type_list<other_property_list_tys...>>, |
128 |
| - other_property_tys...) { |
129 |
| - return 42; |
130 |
| -} |
131 |
| -static_assert(merge_properties(pl3, naive{}) == 42); |
132 |
| -} // namespace test_group_load_store |
133 |
| - |
134 | 74 | namespace test_merge_ctor {
|
135 | 75 | template <int N> struct property : named_property_base<property<N>> {};
|
136 | 76 |
|
137 | 77 | constexpr properties pl1{property<1>{}, property<2>{}, property<3>{}};
|
138 | 78 | constexpr properties pl2{pl1, property<4>{}};
|
| 79 | +static_assert(!pl1.has_property<property<4>>()); |
| 80 | +static_assert(pl2.has_property<property<2>>()); |
| 81 | +static_assert(pl2.has_property<property<4>>()); |
139 | 82 | } // namespace test_merge_ctor
|
140 | 83 |
|
141 | 84 | namespace test_compile_prop_in_runtime_list {
|
|
0 commit comments