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_stdhash()
14 typedef size_t hash_type;
16 struct traits: public ci::multilevel_hashset::traits
18 typedef get_hash<hash_type> hash_accessor;
19 typedef item_disposer disposer;
21 typedef ci::MultiLevelHashSet< gc_type, Item<hash_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, std::hash<hash_type>>(4, 2);
25 typedef ci::MultiLevelHashSet<
28 typename ci::multilevel_hashset::make_traits<
29 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
30 , ci::opt::disposer< item_disposer >
33 test_hp<set_type2, std::hash<hash_type>>(4, 2);
36 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128()
38 typedef hash128 hash_type;
40 struct traits: public ci::multilevel_hashset::traits
42 typedef get_hash<hash_type> hash_accessor;
43 typedef item_disposer disposer;
44 typedef hash128::less less;
46 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
47 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
48 test_hp<set_type, hash128::make>(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 >
56 , ci::opt::less< hash_type::less >
59 test_hp<set_type2, hash128::make>(4, 2);
62 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash_stat()
64 typedef size_t hash_type;
66 struct traits: public ci::multilevel_hashset::traits
68 typedef get_hash<hash_type> hash_accessor;
69 typedef item_disposer disposer;
70 typedef ci::multilevel_hashset::stat<> stat;
72 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
73 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
74 test_hp<set_type, std::hash<hash_type>>(4, 2);
76 typedef ci::MultiLevelHashSet<
79 typename ci::multilevel_hashset::make_traits<
80 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
81 , ci::opt::disposer< item_disposer >
82 ,co::stat< ci::multilevel_hashset::stat<>>
85 test_hp<set_type2, std::hash<hash_type>>(4, 2);
88 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128_stat()
90 typedef hash128 hash_type;
92 struct traits: public ci::multilevel_hashset::traits
94 typedef get_hash<hash_type> hash_accessor;
95 typedef item_disposer disposer;
96 typedef hash128::cmp compare;
97 typedef ci::multilevel_hashset::stat<> stat;
99 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
100 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
101 test_hp<set_type, hash_type::make>(4, 2);
103 typedef ci::MultiLevelHashSet<
106 typename ci::multilevel_hashset::make_traits<
107 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
108 , ci::opt::disposer< item_disposer >
109 ,co::stat< ci::multilevel_hashset::stat<>>
110 ,co::compare< hash128::cmp >
113 test_hp<set_type2, hash_type::make>(4, 2);
116 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash_5_3()
118 typedef size_t hash_type;
120 struct traits: public ci::multilevel_hashset::traits
122 typedef get_hash<hash_type> hash_accessor;
123 typedef item_disposer disposer;
125 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
126 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
127 test_hp<set_type, std::hash<hash_type>>(5, 3);
129 typedef ci::MultiLevelHashSet<
132 typename ci::multilevel_hashset::make_traits<
133 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
134 , ci::opt::disposer< item_disposer >
137 test_hp<set_type2, std::hash<hash_type>>(5, 3);
140 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128_4_3()
142 typedef hash128 hash_type;
144 struct traits: public ci::multilevel_hashset::traits
146 typedef get_hash<hash_type> hash_accessor;
147 typedef item_disposer disposer;
148 typedef co::v::sequential_consistent memory_model;
150 typedef ci::MultiLevelHashSet< gc_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_hp<set_type, hash128::make >(4, 3);
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::memory_model< co::v::sequential_consistent >
163 test_hp<set_type2, hash128::make >(4, 3);
166 void IntrusiveMultiLevelHashSetHdrTest::dhp_stdhash_5_3_stat()
168 typedef size_t hash_type;
170 struct traits: public ci::multilevel_hashset::traits
172 typedef get_hash<hash_type> hash_accessor;
173 typedef item_disposer disposer;
174 typedef ci::multilevel_hashset::stat<> stat;
176 typedef ci::MultiLevelHashSet< gc_type, Item<hash_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_hp<set_type, std::hash<hash_type>>(5, 3);
180 typedef ci::MultiLevelHashSet<
183 typename ci::multilevel_hashset::make_traits<
184 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
185 , ci::opt::disposer< item_disposer >
186 ,co::stat< ci::multilevel_hashset::stat<>>
189 test_hp<set_type2, std::hash<hash_type>>(5, 3);
192 void IntrusiveMultiLevelHashSetHdrTest::dhp_hash128_4_3_stat()
194 typedef hash128 hash_type;
196 struct traits: public ci::multilevel_hashset::traits
198 typedef get_hash<hash_type> hash_accessor;
199 typedef item_disposer disposer;
200 typedef ci::multilevel_hashset::stat<> stat;
201 typedef hash128::less less;
202 typedef hash128::cmp compare;
204 typedef ci::MultiLevelHashSet< gc_type, Item<hash_type>, traits > set_type;
205 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
206 test_hp<set_type, hash_type::make>(4, 3);
208 typedef ci::MultiLevelHashSet<
211 typename ci::multilevel_hashset::make_traits<
212 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
213 , ci::opt::disposer< item_disposer >
214 , co::stat< ci::multilevel_hashset::stat<>>
215 , co::less< hash_type::less >
216 , co::compare< hash128::cmp >
219 test_hp<set_type2, hash_type::make>(4, 3);