3 #include "set/hdr_intrusive_multilevel_hashset.h"
4 #include <cds/intrusive/multilevel_hashset_dhp.h>
5 #include "unit/print_multilevel_hashset_stat.h"
9 typedef cds::gc::DHP gc_type;
12 void IntrusiveMultiLevelHashSetHdrTest::dhp_nohash()
14 typedef size_t key_type;
16 struct traits : public ci::multilevel_hashset::traits
18 typedef get_key<key_type> hash_accessor;
19 typedef item_disposer disposer;
21 typedef ci::MultiLevelHashSet< gc_type, Item<key_type>, traits > set_type;
22 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
23 test_hp<set_type, nohash<key_type>>(4, 2);
25 typedef ci::MultiLevelHashSet<
28 typename ci::multilevel_hashset::make_traits<
29 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
30 , ci::opt::disposer< item_disposer >
33 test_hp<set_type2, nohash<key_type>>(4, 2);
36 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash()
38 typedef size_t hash_type;
40 struct traits: public ci::multilevel_hashset::traits
42 typedef get_hash<hash_type> hash_accessor;
43 typedef item_disposer disposer;
45 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
46 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
47 test_hp<set_type, std::hash<hash_type>>(4, 2);
49 typedef ci::MultiLevelHashSet<
52 typename ci::multilevel_hashset::make_traits<
53 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
54 , ci::opt::disposer< item_disposer >
57 test_hp<set_type2, std::hash<hash_type>>(4, 2);
60 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128()
62 typedef hash128 hash_type;
64 struct traits: public ci::multilevel_hashset::traits
66 typedef get_hash<hash_type> hash_accessor;
67 typedef item_disposer disposer;
68 typedef hash128::less less;
70 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
71 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
72 test_hp<set_type, hash128::make>(4, 2);
74 typedef ci::MultiLevelHashSet<
77 typename ci::multilevel_hashset::make_traits<
78 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
79 , ci::opt::disposer< item_disposer >
80 , ci::opt::less< hash_type::less >
83 test_hp<set_type2, hash128::make>(4, 2);
86 void IntrusiveMultiLevelHashSetHdrTest::dhp_nohash_stat()
88 typedef size_t key_type;
90 struct traits : public ci::multilevel_hashset::traits
92 typedef get_key<key_type> hash_accessor;
93 typedef item_disposer disposer;
94 typedef ci::multilevel_hashset::stat<> stat;
96 typedef ci::MultiLevelHashSet< gc_type, Item<key_type>, traits > set_type;
97 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
98 test_hp<set_type, nohash<key_type>>(4, 2);
100 typedef ci::MultiLevelHashSet<
103 typename ci::multilevel_hashset::make_traits<
104 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
105 , ci::opt::disposer< item_disposer >
106 , co::stat< ci::multilevel_hashset::stat<>>
109 test_hp<set_type2, nohash<key_type>>(4, 2);
112 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash_stat()
114 typedef size_t hash_type;
116 struct traits: public ci::multilevel_hashset::traits
118 typedef get_hash<hash_type> hash_accessor;
119 typedef item_disposer disposer;
120 typedef ci::multilevel_hashset::stat<> stat;
122 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
123 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
124 test_hp<set_type, std::hash<hash_type>>(4, 2);
126 typedef ci::MultiLevelHashSet<
129 typename ci::multilevel_hashset::make_traits<
130 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
131 , ci::opt::disposer< item_disposer >
132 ,co::stat< ci::multilevel_hashset::stat<>>
135 test_hp<set_type2, std::hash<hash_type>>(4, 2);
138 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128_stat()
140 typedef hash128 hash_type;
142 struct traits: public ci::multilevel_hashset::traits
144 typedef get_hash<hash_type> hash_accessor;
145 typedef item_disposer disposer;
146 typedef hash128::cmp compare;
147 typedef ci::multilevel_hashset::stat<> stat;
149 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
150 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
151 test_hp<set_type, hash_type::make>(4, 2);
153 typedef ci::MultiLevelHashSet<
156 typename ci::multilevel_hashset::make_traits<
157 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
158 , ci::opt::disposer< item_disposer >
159 ,co::stat< ci::multilevel_hashset::stat<>>
160 ,co::compare< hash128::cmp >
163 test_hp<set_type2, hash_type::make>(4, 2);
166 void IntrusiveMultiLevelHashSetHdrTest::dhp_nohash_5_3()
168 typedef size_t key_type;
170 struct traits : public ci::multilevel_hashset::traits
172 typedef get_key<key_type> hash_accessor;
173 typedef item_disposer disposer;
175 typedef ci::MultiLevelHashSet< gc_type, Item<key_type>, traits > set_type;
176 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
177 test_hp<set_type, nohash<key_type>>(5, 3);
179 typedef ci::MultiLevelHashSet<
182 typename ci::multilevel_hashset::make_traits<
183 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
184 , ci::opt::disposer< item_disposer >
187 test_hp<set_type2, nohash<key_type>>(5, 3);
190 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash_5_3()
192 typedef size_t hash_type;
194 struct traits: public ci::multilevel_hashset::traits
196 typedef get_hash<hash_type> hash_accessor;
197 typedef item_disposer disposer;
199 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
200 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
201 test_hp<set_type, std::hash<hash_type>>(5, 3);
203 typedef ci::MultiLevelHashSet<
206 typename ci::multilevel_hashset::make_traits<
207 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
208 , ci::opt::disposer< item_disposer >
211 test_hp<set_type2, std::hash<hash_type>>(5, 3);
214 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128_4_3()
216 typedef hash128 hash_type;
218 struct traits: public ci::multilevel_hashset::traits
220 typedef get_hash<hash_type> hash_accessor;
221 typedef item_disposer disposer;
222 typedef co::v::sequential_consistent memory_model;
224 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
225 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
226 test_hp<set_type, hash128::make >(4, 3);
228 typedef ci::MultiLevelHashSet<
231 typename ci::multilevel_hashset::make_traits<
232 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
233 , ci::opt::disposer< item_disposer >
234 ,co::memory_model< co::v::sequential_consistent >
237 test_hp<set_type2, hash128::make >(4, 3);
240 void IntrusiveMultiLevelHashSetHdrTest::dhp_nohash_5_3_stat()
242 typedef size_t key_type;
244 struct traits: public ci::multilevel_hashset::traits
246 typedef get_key<key_type> hash_accessor;
247 typedef item_disposer disposer;
248 typedef ci::multilevel_hashset::stat<> stat;
250 typedef ci::MultiLevelHashSet< gc_type, Item<key_type>, traits > set_type;
251 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
252 test_hp<set_type, nohash<key_type>>(5, 3);
254 typedef ci::MultiLevelHashSet<
257 typename ci::multilevel_hashset::make_traits<
258 ci::multilevel_hashset::hash_accessor< get_key<key_type>>
259 , ci::opt::disposer< item_disposer >
260 ,co::stat< ci::multilevel_hashset::stat<>>
263 test_hp<set_type2, nohash<key_type>>(5, 3);
266 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash_5_3_stat()
268 typedef size_t hash_type;
270 struct traits: public ci::multilevel_hashset::traits
272 typedef get_hash<hash_type> hash_accessor;
273 typedef item_disposer disposer;
274 typedef ci::multilevel_hashset::stat<> stat;
276 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
277 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
278 test_hp<set_type, std::hash<hash_type>>(5, 3);
280 typedef ci::MultiLevelHashSet<
283 typename ci::multilevel_hashset::make_traits<
284 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
285 , ci::opt::disposer< item_disposer >
286 ,co::stat< ci::multilevel_hashset::stat<>>
289 test_hp<set_type2, std::hash<hash_type>>(5, 3);
292 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128_4_3_stat()
294 typedef hash128 hash_type;
296 struct traits: public ci::multilevel_hashset::traits
298 typedef get_hash<hash_type> hash_accessor;
299 typedef item_disposer disposer;
300 typedef ci::multilevel_hashset::stat<> stat;
301 typedef hash128::less less;
302 typedef hash128::cmp compare;
304 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
305 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
306 test_hp<set_type, hash_type::make>(4, 3);
308 typedef ci::MultiLevelHashSet<
311 typename ci::multilevel_hashset::make_traits<
312 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
313 , ci::opt::disposer< item_disposer >
314 , co::stat< ci::multilevel_hashset::stat<>>
315 , co::less< hash_type::less >
316 , co::compare< hash128::cmp >
319 test_hp<set_type2, hash_type::make>(4, 3);