3 #include "set/hdr_feldman_hashset.h"
4 #include <cds/urcu/signal_buffered.h>
5 #include <cds/container/feldman_hashset_rcu.h>
6 #include "unit/print_feldman_hashset_stat.h"
9 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
11 typedef cds::urcu::gc<cds::urcu::signal_buffered<>> rcu_type;
15 void FeldmanHashSetHdrTest::rcu_shb_nohash()
17 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
18 typedef size_t key_type;
20 struct traits : public cc::feldman_hashset::traits
22 typedef get_key<key_type> hash_accessor;
24 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
25 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
26 test_rcu<set_type, nohash<key_type>>(4, 2);
28 typedef cc::FeldmanHashSet<
31 typename cc::feldman_hashset::make_traits<
32 cc::feldman_hashset::hash_accessor< get_key<key_type>>
35 test_rcu<set_type2, nohash<key_type>>(4, 2);
39 void FeldmanHashSetHdrTest::rcu_shb_stdhash()
41 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
42 typedef size_t hash_type;
44 struct traits: public cc::feldman_hashset::traits
46 typedef get_hash<hash_type> hash_accessor;
48 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
49 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
50 test_rcu<set_type, std::hash<hash_type>>(4, 2);
52 typedef cc::FeldmanHashSet<
55 typename cc::feldman_hashset::make_traits<
56 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
59 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
63 void FeldmanHashSetHdrTest::rcu_shb_hash128()
65 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
66 typedef hash128 hash_type;
68 struct traits: public cc::feldman_hashset::traits
70 typedef get_hash<hash_type> hash_accessor;
71 typedef hash128::less less;
73 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
74 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
75 test_rcu<set_type, hash128::make>(4, 2);
77 typedef cc::FeldmanHashSet<
80 typename cc::feldman_hashset::make_traits<
81 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
82 , co::less< hash_type::less >
85 test_rcu<set_type2, hash128::make>(4, 2);
89 void FeldmanHashSetHdrTest::rcu_shb_nohash_stat()
91 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
92 typedef size_t key_type;
94 struct traits : public cc::feldman_hashset::traits
96 typedef get_key<key_type> hash_accessor;
97 typedef cc::feldman_hashset::stat<> stat;
99 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
100 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
101 test_rcu<set_type, nohash<key_type>>(4, 2);
103 typedef cc::FeldmanHashSet<
106 typename cc::feldman_hashset::make_traits<
107 cc::feldman_hashset::hash_accessor< get_key<key_type>>
108 , co::stat< cc::feldman_hashset::stat<>>
111 test_rcu<set_type2, nohash<key_type>>(4, 2);
115 void FeldmanHashSetHdrTest::rcu_shb_stdhash_stat()
117 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
118 typedef size_t hash_type;
120 struct traits: public cc::feldman_hashset::traits
122 typedef get_hash<hash_type> hash_accessor;
123 typedef cc::feldman_hashset::stat<> stat;
125 typedef cc::FeldmanHashSet< rcu_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_rcu<set_type, std::hash<hash_type>>(4, 2);
129 typedef cc::FeldmanHashSet<
132 typename cc::feldman_hashset::make_traits<
133 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
134 ,co::stat< cc::feldman_hashset::stat<>>
137 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
141 void FeldmanHashSetHdrTest::rcu_shb_hash128_stat()
143 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
144 typedef hash128 hash_type;
146 struct traits: public cc::feldman_hashset::traits
148 typedef get_hash<hash_type> hash_accessor;
149 typedef hash128::cmp compare;
150 typedef cc::feldman_hashset::stat<> stat;
152 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
153 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
154 test_rcu<set_type, hash_type::make>(4, 2);
156 typedef cc::FeldmanHashSet<
159 typename cc::feldman_hashset::make_traits<
160 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
161 ,co::stat< cc::feldman_hashset::stat<>>
162 ,co::compare< hash128::cmp >
165 test_rcu<set_type2, hash_type::make>(4, 2);
169 void FeldmanHashSetHdrTest::rcu_shb_nohash_5_3()
171 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
172 typedef size_t key_type;
174 struct traits: public cc::feldman_hashset::traits
176 typedef get_key<key_type> hash_accessor;
178 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
179 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
180 test_rcu<set_type, nohash<key_type>>(5, 3);
182 typedef cc::FeldmanHashSet<
185 typename cc::feldman_hashset::make_traits<
186 cc::feldman_hashset::hash_accessor< get_key<key_type>>
189 test_rcu<set_type2, nohash<key_type>>(5, 3);
193 void FeldmanHashSetHdrTest::rcu_shb_stdhash_5_3()
195 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
196 typedef size_t hash_type;
198 struct traits: public cc::feldman_hashset::traits
200 typedef get_hash<hash_type> hash_accessor;
202 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
203 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
204 test_rcu<set_type, std::hash<hash_type>>(5, 3);
206 typedef cc::FeldmanHashSet<
209 typename cc::feldman_hashset::make_traits<
210 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
213 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
217 void FeldmanHashSetHdrTest::rcu_shb_hash128_4_3()
219 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
220 typedef hash128 hash_type;
222 struct traits: public cc::feldman_hashset::traits
224 typedef get_hash<hash_type> hash_accessor;
225 typedef co::v::sequential_consistent memory_model;
227 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
228 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
229 test_rcu<set_type, hash128::make >(4, 3);
231 typedef cc::FeldmanHashSet<
234 typename cc::feldman_hashset::make_traits<
235 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
236 ,co::memory_model< co::v::sequential_consistent >
239 test_rcu<set_type2, hash128::make >(4, 3);
243 void FeldmanHashSetHdrTest::rcu_shb_nohash_5_3_stat()
245 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
246 typedef size_t key_type;
248 struct traits: public cc::feldman_hashset::traits
250 typedef get_key<key_type> hash_accessor;
251 typedef cc::feldman_hashset::stat<> stat;
253 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
254 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
255 test_rcu<set_type, nohash<key_type>>(5, 3);
257 typedef cc::FeldmanHashSet<
260 typename cc::feldman_hashset::make_traits<
261 cc::feldman_hashset::hash_accessor< get_key<key_type>>
262 ,co::stat< cc::feldman_hashset::stat<>>
265 test_rcu<set_type2, nohash<key_type>>(5, 3);
269 void FeldmanHashSetHdrTest::rcu_shb_stdhash_5_3_stat()
271 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
272 typedef size_t hash_type;
274 struct traits: public cc::feldman_hashset::traits
276 typedef get_hash<hash_type> hash_accessor;
277 typedef cc::feldman_hashset::stat<> stat;
279 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
280 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
281 test_rcu<set_type, std::hash<hash_type>>(5, 3);
283 typedef cc::FeldmanHashSet<
286 typename cc::feldman_hashset::make_traits<
287 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
288 ,co::stat< cc::feldman_hashset::stat<>>
291 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
295 void FeldmanHashSetHdrTest::rcu_shb_hash128_4_3_stat()
297 #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED
298 typedef hash128 hash_type;
300 struct traits: public cc::feldman_hashset::traits
302 typedef get_hash<hash_type> hash_accessor;
303 typedef cc::feldman_hashset::stat<> stat;
304 typedef hash128::less less;
305 typedef hash128::cmp compare;
307 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
308 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
309 test_rcu<set_type, hash_type::make>(4, 3);
311 typedef cc::FeldmanHashSet<
314 typename cc::feldman_hashset::make_traits<
315 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
316 , co::stat< cc::feldman_hashset::stat<>>
317 , co::less< hash_type::less >
318 , co::compare< hash128::cmp >
321 test_rcu<set_type2, hash_type::make>(4, 3);