3 #include "set/hdr_intrusive_multilevel_hashset.h"
4 #include <cds/urcu/general_threaded.h>
5 #include <cds/intrusive/multilevel_hashset_rcu.h>
6 #include "unit/print_multilevel_hashset_stat.h"
10 typedef cds::urcu::gc<cds::urcu::general_threaded<>> rcu_type;
13 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_nohash()
15 typedef size_t key_type;
17 struct traits : public ci::multilevel_hashset::traits
19 typedef get_key<key_type> hash_accessor;
20 typedef item_disposer disposer;
22 typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
23 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
24 test_rcu<set_type, nohash<key_type>>(4, 2);
26 typedef ci::MultiLevelHashSet<
29 typename ci::multilevel_hashset::make_traits<
30 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
31 , ci::opt::disposer< item_disposer >
34 test_rcu<set_type2, nohash<key_type>>(4, 2);
37 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_stdhash()
39 typedef size_t hash_type;
41 struct traits: public ci::multilevel_hashset::traits
43 typedef get_hash<hash_type> hash_accessor;
44 typedef item_disposer disposer;
46 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
47 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
48 test_rcu<set_type, std::hash<hash_type>>(4, 2);
50 typedef ci::MultiLevelHashSet<
53 typename ci::multilevel_hashset::make_traits<
54 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
55 , ci::opt::disposer< item_disposer >
58 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
61 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_hash128()
63 typedef hash128 hash_type;
65 struct traits: public ci::multilevel_hashset::traits
67 typedef get_hash<hash_type> hash_accessor;
68 typedef item_disposer disposer;
69 typedef hash128::less less;
71 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
72 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
73 test_rcu<set_type, hash128::make>(4, 2);
75 typedef ci::MultiLevelHashSet<
78 typename ci::multilevel_hashset::make_traits<
79 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
80 , ci::opt::disposer< item_disposer >
81 , ci::opt::less< hash_type::less >
84 test_rcu<set_type2, hash128::make>(4, 2);
87 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_nohash_stat()
89 typedef size_t key_type;
91 struct traits : public ci::multilevel_hashset::traits
93 typedef get_key<key_type> hash_accessor;
94 typedef item_disposer disposer;
95 typedef ci::multilevel_hashset::stat<> stat;
97 typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
98 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
99 test_rcu<set_type, nohash<key_type>>(4, 2);
101 typedef ci::MultiLevelHashSet<
104 typename ci::multilevel_hashset::make_traits<
105 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
106 , ci::opt::disposer< item_disposer >
107 , co::stat< ci::multilevel_hashset::stat<>>
110 test_rcu<set_type2, nohash<key_type>>(4, 2);
113 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_stdhash_stat()
115 typedef size_t hash_type;
117 struct traits: public ci::multilevel_hashset::traits
119 typedef get_hash<hash_type> hash_accessor;
120 typedef item_disposer disposer;
121 typedef ci::multilevel_hashset::stat<> stat;
123 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
124 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
125 test_rcu<set_type, std::hash<hash_type>>(4, 2);
127 typedef ci::MultiLevelHashSet<
130 typename ci::multilevel_hashset::make_traits<
131 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
132 , ci::opt::disposer< item_disposer >
133 ,co::stat< ci::multilevel_hashset::stat<>>
136 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
139 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_hash128_stat()
141 typedef hash128 hash_type;
143 struct traits: public ci::multilevel_hashset::traits
145 typedef get_hash<hash_type> hash_accessor;
146 typedef item_disposer disposer;
147 typedef hash128::cmp compare;
148 typedef ci::multilevel_hashset::stat<> stat;
150 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
151 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
152 test_rcu<set_type, hash_type::make>(4, 2);
154 typedef ci::MultiLevelHashSet<
157 typename ci::multilevel_hashset::make_traits<
158 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
159 , ci::opt::disposer< item_disposer >
160 ,co::stat< ci::multilevel_hashset::stat<>>
161 ,co::compare< hash128::cmp >
164 test_rcu<set_type2, hash_type::make>(4, 2);
167 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_nohash_5_3()
169 typedef size_t key_type;
171 struct traits : public ci::multilevel_hashset::traits
173 typedef get_key<key_type> hash_accessor;
174 typedef item_disposer disposer;
176 typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
177 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
178 test_rcu<set_type, nohash<key_type>>(5, 3);
180 typedef ci::MultiLevelHashSet<
183 typename ci::multilevel_hashset::make_traits<
184 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
185 , ci::opt::disposer< item_disposer >
188 test_rcu<set_type2, nohash<key_type>>(5, 3);
191 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_stdhash_5_3()
193 typedef size_t hash_type;
195 struct traits: public ci::multilevel_hashset::traits
197 typedef get_hash<hash_type> hash_accessor;
198 typedef item_disposer disposer;
200 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
201 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
202 test_rcu<set_type, std::hash<hash_type>>(5, 3);
204 typedef ci::MultiLevelHashSet<
207 typename ci::multilevel_hashset::make_traits<
208 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
209 , ci::opt::disposer< item_disposer >
212 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
215 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_hash128_4_3()
217 typedef hash128 hash_type;
219 struct traits: public ci::multilevel_hashset::traits
221 typedef get_hash<hash_type> hash_accessor;
222 typedef item_disposer disposer;
223 typedef co::v::sequential_consistent memory_model;
225 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
226 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
227 test_rcu<set_type, hash128::make >(4, 3);
229 typedef ci::MultiLevelHashSet<
232 typename ci::multilevel_hashset::make_traits<
233 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
234 , ci::opt::disposer< item_disposer >
235 ,co::memory_model< co::v::sequential_consistent >
238 test_rcu<set_type2, hash128::make >(4, 3);
241 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_nohash_5_3_stat()
243 typedef size_t key_type;
245 struct traits: public ci::multilevel_hashset::traits
247 typedef get_key<key_type> hash_accessor;
248 typedef item_disposer disposer;
249 typedef ci::multilevel_hashset::stat<> stat;
251 typedef ci::MultiLevelHashSet< rcu_type, Item<key_type>, traits > set_type;
252 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
253 test_rcu<set_type, nohash<key_type>>(5, 3);
255 typedef ci::MultiLevelHashSet<
258 typename ci::multilevel_hashset::make_traits<
259 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
260 , ci::opt::disposer< item_disposer >
261 ,co::stat< ci::multilevel_hashset::stat<>>
264 test_rcu<set_type2, nohash<key_type>>(5, 3);
267 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_stdhash_5_3_stat()
269 typedef size_t hash_type;
271 struct traits: public ci::multilevel_hashset::traits
273 typedef get_hash<hash_type> hash_accessor;
274 typedef item_disposer disposer;
275 typedef ci::multilevel_hashset::stat<> stat;
277 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
278 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
279 test_rcu<set_type, std::hash<hash_type>>(5, 3);
281 typedef ci::MultiLevelHashSet<
284 typename ci::multilevel_hashset::make_traits<
285 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
286 , ci::opt::disposer< item_disposer >
287 ,co::stat< ci::multilevel_hashset::stat<>>
290 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
293 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpt_hash128_4_3_stat()
295 typedef hash128 hash_type;
297 struct traits: public ci::multilevel_hashset::traits
299 typedef get_hash<hash_type> hash_accessor;
300 typedef item_disposer disposer;
301 typedef ci::multilevel_hashset::stat<> stat;
302 typedef hash128::less less;
303 typedef hash128::cmp compare;
305 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
306 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
307 test_rcu<set_type, hash_type::make>(4, 3);
309 typedef ci::MultiLevelHashSet<
312 typename ci::multilevel_hashset::make_traits<
313 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
314 , ci::opt::disposer< item_disposer >
315 , co::stat< ci::multilevel_hashset::stat<>>
316 , co::less< hash_type::less >
317 , co::compare< hash128::cmp >
320 test_rcu<set_type2, hash_type::make>(4, 3);