3 #include "set/hdr_intrusive_multilevel_hashset.h"
4 #include <cds/urcu/signal_threaded.h>
5 #include <cds/intrusive/multilevel_hashset_rcu.h>
6 #include "unit/print_multilevel_hashset_stat.h"
10 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
12 typedef cds::urcu::gc<cds::urcu::signal_threaded<>> rcu_type;
16 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_stdhash()
18 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
19 typedef size_t hash_type;
21 struct traits: public ci::multilevel_hashset::traits
23 typedef get_hash<hash_type> hash_accessor;
24 typedef item_disposer disposer;
26 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
27 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
28 test_rcu<set_type, std::hash<hash_type>>(4, 2);
30 typedef ci::MultiLevelHashSet<
33 typename ci::multilevel_hashset::make_traits<
34 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
35 , ci::opt::disposer< item_disposer >
38 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
42 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_hash128()
44 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
45 typedef hash128 hash_type;
47 struct traits: public ci::multilevel_hashset::traits
49 typedef get_hash<hash_type> hash_accessor;
50 typedef item_disposer disposer;
51 typedef hash128::less less;
53 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
54 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
55 test_rcu<set_type, hash128::make>(4, 2);
57 typedef ci::MultiLevelHashSet<
60 typename ci::multilevel_hashset::make_traits<
61 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
62 , ci::opt::disposer< item_disposer >
63 , ci::opt::less< hash_type::less >
66 test_rcu<set_type2, hash128::make>(4, 2);
70 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_stdhash_stat()
72 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
73 typedef size_t hash_type;
75 struct traits: public ci::multilevel_hashset::traits
77 typedef get_hash<hash_type> hash_accessor;
78 typedef item_disposer disposer;
79 typedef ci::multilevel_hashset::stat<> stat;
81 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
82 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
83 test_rcu<set_type, std::hash<hash_type>>(4, 2);
85 typedef ci::MultiLevelHashSet<
88 typename ci::multilevel_hashset::make_traits<
89 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
90 , ci::opt::disposer< item_disposer >
91 ,co::stat< ci::multilevel_hashset::stat<>>
94 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
98 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_hash128_stat()
100 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
101 typedef hash128 hash_type;
103 struct traits: public ci::multilevel_hashset::traits
105 typedef get_hash<hash_type> hash_accessor;
106 typedef item_disposer disposer;
107 typedef hash128::cmp compare;
108 typedef ci::multilevel_hashset::stat<> stat;
110 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
111 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
112 test_rcu<set_type, hash_type::make>(4, 2);
114 typedef ci::MultiLevelHashSet<
117 typename ci::multilevel_hashset::make_traits<
118 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
119 , ci::opt::disposer< item_disposer >
120 ,co::stat< ci::multilevel_hashset::stat<>>
121 ,co::compare< hash128::cmp >
124 test_rcu<set_type2, hash_type::make>(4, 2);
128 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_stdhash_5_3()
130 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
131 typedef size_t hash_type;
133 struct traits: public ci::multilevel_hashset::traits
135 typedef get_hash<hash_type> hash_accessor;
136 typedef item_disposer disposer;
138 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
139 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
140 test_rcu<set_type, std::hash<hash_type>>(5, 3);
142 typedef ci::MultiLevelHashSet<
145 typename ci::multilevel_hashset::make_traits<
146 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
147 , ci::opt::disposer< item_disposer >
150 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
154 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_hash128_4_3()
156 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
157 typedef hash128 hash_type;
159 struct traits: public ci::multilevel_hashset::traits
161 typedef get_hash<hash_type> hash_accessor;
162 typedef item_disposer disposer;
163 typedef co::v::sequential_consistent memory_model;
165 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
166 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
167 test_rcu<set_type, hash128::make >(4, 3);
169 typedef ci::MultiLevelHashSet<
172 typename ci::multilevel_hashset::make_traits<
173 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
174 , ci::opt::disposer< item_disposer >
175 ,co::memory_model< co::v::sequential_consistent >
178 test_rcu<set_type2, hash128::make >(4, 3);
182 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_stdhash_5_3_stat()
184 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
185 typedef size_t hash_type;
187 struct traits: public ci::multilevel_hashset::traits
189 typedef get_hash<hash_type> hash_accessor;
190 typedef item_disposer disposer;
191 typedef ci::multilevel_hashset::stat<> stat;
193 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
194 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
195 test_rcu<set_type, std::hash<hash_type>>(5, 3);
197 typedef ci::MultiLevelHashSet<
200 typename ci::multilevel_hashset::make_traits<
201 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
202 , ci::opt::disposer< item_disposer >
203 ,co::stat< ci::multilevel_hashset::stat<>>
206 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
210 void IntrusiveMultiLevelHashSetHdrTest::rcu_sht_hash128_4_3_stat()
212 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
213 typedef hash128 hash_type;
215 struct traits: public ci::multilevel_hashset::traits
217 typedef get_hash<hash_type> hash_accessor;
218 typedef item_disposer disposer;
219 typedef ci::multilevel_hashset::stat<> stat;
220 typedef hash128::less less;
221 typedef hash128::cmp compare;
223 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
224 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
225 test_rcu<set_type, hash_type::make>(4, 3);
227 typedef ci::MultiLevelHashSet<
230 typename ci::multilevel_hashset::make_traits<
231 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
232 , ci::opt::disposer< item_disposer >
233 , co::stat< ci::multilevel_hashset::stat<>>
234 , co::less< hash_type::less >
235 , co::compare< hash128::cmp >
238 test_rcu<set_type2, hash_type::make>(4, 3);