3 #include "set/hdr_feldman_hashset.h"
4 #include <cds/urcu/general_threaded.h>
5 #include <cds/container/feldman_hashset_rcu.h>
6 #include "unit/print_feldman_hashset_stat.h"
10 typedef cds::urcu::gc<cds::urcu::general_threaded<>> rcu_type;
13 void FeldmanHashSetHdrTest::rcu_gpt_nohash()
15 typedef size_t key_type;
17 struct traits : public cc::feldman_hashset::traits
19 typedef get_key<key_type> hash_accessor;
21 typedef cc::FeldmanHashSet< rcu_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_rcu<set_type, nohash<key_type>>(4, 2);
25 typedef cc::FeldmanHashSet<
28 typename cc::feldman_hashset::make_traits<
29 cc::feldman_hashset::hash_accessor< get_key<key_type>>
32 test_rcu<set_type2, nohash<key_type>>(4, 2);
35 void FeldmanHashSetHdrTest::rcu_gpt_stdhash()
37 typedef size_t hash_type;
39 struct traits: public cc::feldman_hashset::traits
41 typedef get_hash<hash_type> hash_accessor;
43 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
44 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
45 test_rcu<set_type, std::hash<hash_type>>(4, 2);
47 typedef cc::FeldmanHashSet<
50 typename cc::feldman_hashset::make_traits<
51 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
54 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
57 void FeldmanHashSetHdrTest::rcu_gpt_hash128()
59 typedef hash128 hash_type;
61 struct traits: public cc::feldman_hashset::traits
63 typedef get_hash<hash_type> hash_accessor;
64 typedef hash128::less less;
66 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
67 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
68 test_rcu<set_type, hash128::make>(4, 2);
70 typedef cc::FeldmanHashSet<
73 typename cc::feldman_hashset::make_traits<
74 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
75 , co::less< hash_type::less >
78 test_rcu<set_type2, hash128::make>(4, 2);
81 void FeldmanHashSetHdrTest::rcu_gpt_nohash_stat()
83 typedef size_t key_type;
85 struct traits : public cc::feldman_hashset::traits
87 typedef get_key<key_type> hash_accessor;
88 typedef cc::feldman_hashset::stat<> stat;
90 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
91 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!");
92 test_rcu<set_type, nohash<key_type>>(4, 2);
94 typedef cc::FeldmanHashSet<
97 typename cc::feldman_hashset::make_traits<
98 cc::feldman_hashset::hash_accessor< get_key<key_type>>
99 , co::stat< cc::feldman_hashset::stat<>>
102 test_rcu<set_type2, nohash<key_type>>(4, 2);
105 void FeldmanHashSetHdrTest::rcu_gpt_stdhash_stat()
107 typedef size_t hash_type;
109 struct traits: public cc::feldman_hashset::traits
111 typedef get_hash<hash_type> hash_accessor;
112 typedef cc::feldman_hashset::stat<> stat;
114 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
115 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
116 test_rcu<set_type, std::hash<hash_type>>(4, 2);
118 typedef cc::FeldmanHashSet<
121 typename cc::feldman_hashset::make_traits<
122 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
123 ,co::stat< cc::feldman_hashset::stat<>>
126 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
129 void FeldmanHashSetHdrTest::rcu_gpt_hash128_stat()
131 typedef hash128 hash_type;
133 struct traits: public cc::feldman_hashset::traits
135 typedef get_hash<hash_type> hash_accessor;
136 typedef hash128::cmp compare;
137 typedef cc::feldman_hashset::stat<> stat;
139 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
140 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
141 test_rcu<set_type, hash_type::make>(4, 2);
143 typedef cc::FeldmanHashSet<
146 typename cc::feldman_hashset::make_traits<
147 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
148 ,co::stat< cc::feldman_hashset::stat<>>
149 ,co::compare< hash128::cmp >
152 test_rcu<set_type2, hash_type::make>(4, 2);
155 void FeldmanHashSetHdrTest::rcu_gpt_nohash_5_3()
157 typedef size_t key_type;
159 struct traits: public cc::feldman_hashset::traits
161 typedef get_key<key_type> hash_accessor;
163 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
164 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
165 test_rcu<set_type, nohash<key_type>>(5, 3);
167 typedef cc::FeldmanHashSet<
170 typename cc::feldman_hashset::make_traits<
171 cc::feldman_hashset::hash_accessor< get_key<key_type>>
174 test_rcu<set_type2, nohash<key_type>>(5, 3);
177 void FeldmanHashSetHdrTest::rcu_gpt_stdhash_5_3()
179 typedef size_t hash_type;
181 struct traits: public cc::feldman_hashset::traits
183 typedef get_hash<hash_type> hash_accessor;
185 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
186 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
187 test_rcu<set_type, std::hash<hash_type>>(5, 3);
189 typedef cc::FeldmanHashSet<
192 typename cc::feldman_hashset::make_traits<
193 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
196 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
199 void FeldmanHashSetHdrTest::rcu_gpt_hash128_4_3()
201 typedef hash128 hash_type;
203 struct traits: public cc::feldman_hashset::traits
205 typedef get_hash<hash_type> hash_accessor;
206 typedef co::v::sequential_consistent memory_model;
208 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
209 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
210 test_rcu<set_type, hash128::make >(4, 3);
212 typedef cc::FeldmanHashSet<
215 typename cc::feldman_hashset::make_traits<
216 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
217 ,co::memory_model< co::v::sequential_consistent >
220 test_rcu<set_type2, hash128::make >(4, 3);
223 void FeldmanHashSetHdrTest::rcu_gpt_nohash_5_3_stat()
225 typedef size_t key_type;
227 struct traits: public cc::feldman_hashset::traits
229 typedef get_key<key_type> hash_accessor;
230 typedef cc::feldman_hashset::stat<> stat;
232 typedef cc::FeldmanHashSet< rcu_type, Item<key_type>, traits > set_type;
233 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
234 test_rcu<set_type, nohash<key_type>>(5, 3);
236 typedef cc::FeldmanHashSet<
239 typename cc::feldman_hashset::make_traits<
240 cc::feldman_hashset::hash_accessor< get_key<key_type>>
241 ,co::stat< cc::feldman_hashset::stat<>>
244 test_rcu<set_type2, nohash<key_type>>(5, 3);
247 void FeldmanHashSetHdrTest::rcu_gpt_stdhash_5_3_stat()
249 typedef size_t hash_type;
251 struct traits: public cc::feldman_hashset::traits
253 typedef get_hash<hash_type> hash_accessor;
254 typedef cc::feldman_hashset::stat<> stat;
256 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
257 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
258 test_rcu<set_type, std::hash<hash_type>>(5, 3);
260 typedef cc::FeldmanHashSet<
263 typename cc::feldman_hashset::make_traits<
264 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
265 ,co::stat< cc::feldman_hashset::stat<>>
268 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
271 void FeldmanHashSetHdrTest::rcu_gpt_hash128_4_3_stat()
273 typedef hash128 hash_type;
275 struct traits: public cc::feldman_hashset::traits
277 typedef get_hash<hash_type> hash_accessor;
278 typedef cc::feldman_hashset::stat<> stat;
279 typedef hash128::less less;
280 typedef hash128::cmp compare;
282 typedef cc::FeldmanHashSet< rcu_type, Item<hash_type>, traits > set_type;
283 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
284 test_rcu<set_type, hash_type::make>(4, 3);
286 typedef cc::FeldmanHashSet<
289 typename cc::feldman_hashset::make_traits<
290 cc::feldman_hashset::hash_accessor< get_hash<hash_type>>
291 , co::stat< cc::feldman_hashset::stat<>>
292 , co::less< hash_type::less >
293 , co::compare< hash128::cmp >
296 test_rcu<set_type2, hash_type::make>(4, 3);