3 #include "set/hdr_intrusive_multilevel_hashset.h"
4 #include <cds/urcu/general_instant.h>
5 #include <cds/intrusive/multilevel_hashset_rcu.h>
6 #include "unit/print_multilevel_hashset_stat.h"
10 typedef cds::urcu::gc<cds::urcu::general_instant<>> rcu_type;
13 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_stdhash()
15 typedef size_t hash_type;
17 struct traits: public ci::multilevel_hashset::traits
19 typedef get_hash<hash_type> hash_accessor;
20 typedef item_disposer disposer;
22 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
23 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
24 test_rcu<set_type, std::hash<hash_type>>(4, 2);
26 typedef ci::MultiLevelHashSet<
29 typename ci::multilevel_hashset::make_traits<
30 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
31 , ci::opt::disposer< item_disposer >
34 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
37 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_hash128()
39 typedef hash128 hash_type;
41 struct traits: public ci::multilevel_hashset::traits
43 typedef get_hash<hash_type> hash_accessor;
44 typedef item_disposer disposer;
45 typedef hash128::less less;
47 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
48 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
49 test_rcu<set_type, hash128::make>(4, 2);
51 typedef ci::MultiLevelHashSet<
54 typename ci::multilevel_hashset::make_traits<
55 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
56 , ci::opt::disposer< item_disposer >
57 , ci::opt::less< hash_type::less >
60 test_rcu<set_type2, hash128::make>(4, 2);
63 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_stdhash_stat()
65 typedef size_t hash_type;
67 struct traits: public ci::multilevel_hashset::traits
69 typedef get_hash<hash_type> hash_accessor;
70 typedef item_disposer disposer;
71 typedef ci::multilevel_hashset::stat<> stat;
73 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
74 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
75 test_rcu<set_type, std::hash<hash_type>>(4, 2);
77 typedef ci::MultiLevelHashSet<
80 typename ci::multilevel_hashset::make_traits<
81 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
82 , ci::opt::disposer< item_disposer >
83 ,co::stat< ci::multilevel_hashset::stat<>>
86 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
89 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_hash128_stat()
91 typedef hash128 hash_type;
93 struct traits: public ci::multilevel_hashset::traits
95 typedef get_hash<hash_type> hash_accessor;
96 typedef item_disposer disposer;
97 typedef hash128::cmp compare;
98 typedef ci::multilevel_hashset::stat<> stat;
100 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
101 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
102 test_rcu<set_type, hash_type::make>(4, 2);
104 typedef ci::MultiLevelHashSet<
107 typename ci::multilevel_hashset::make_traits<
108 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
109 , ci::opt::disposer< item_disposer >
110 ,co::stat< ci::multilevel_hashset::stat<>>
111 ,co::compare< hash128::cmp >
114 test_rcu<set_type2, hash_type::make>(4, 2);
117 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_stdhash_5_3()
119 typedef size_t hash_type;
121 struct traits: public ci::multilevel_hashset::traits
123 typedef get_hash<hash_type> hash_accessor;
124 typedef item_disposer disposer;
126 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
127 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
128 test_rcu<set_type, std::hash<hash_type>>(5, 3);
130 typedef ci::MultiLevelHashSet<
133 typename ci::multilevel_hashset::make_traits<
134 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
135 , ci::opt::disposer< item_disposer >
138 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
141 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_hash128_4_3()
143 typedef hash128 hash_type;
145 struct traits: public ci::multilevel_hashset::traits
147 typedef get_hash<hash_type> hash_accessor;
148 typedef item_disposer disposer;
149 typedef co::v::sequential_consistent memory_model;
151 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
152 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
153 test_rcu<set_type, hash128::make >(4, 3);
155 typedef ci::MultiLevelHashSet<
158 typename ci::multilevel_hashset::make_traits<
159 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
160 , ci::opt::disposer< item_disposer >
161 ,co::memory_model< co::v::sequential_consistent >
164 test_rcu<set_type2, hash128::make >(4, 3);
167 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_stdhash_5_3_stat()
169 typedef size_t hash_type;
171 struct traits: public ci::multilevel_hashset::traits
173 typedef get_hash<hash_type> hash_accessor;
174 typedef item_disposer disposer;
175 typedef ci::multilevel_hashset::stat<> stat;
177 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
178 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
179 test_rcu<set_type, std::hash<hash_type>>(5, 3);
181 typedef ci::MultiLevelHashSet<
184 typename ci::multilevel_hashset::make_traits<
185 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
186 , ci::opt::disposer< item_disposer >
187 ,co::stat< ci::multilevel_hashset::stat<>>
190 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
193 void IntrusiveMultiLevelHashSetHdrTest::rcu_gpi_hash128_4_3_stat()
195 typedef hash128 hash_type;
197 struct traits: public ci::multilevel_hashset::traits
199 typedef get_hash<hash_type> hash_accessor;
200 typedef item_disposer disposer;
201 typedef ci::multilevel_hashset::stat<> stat;
202 typedef hash128::less less;
203 typedef hash128::cmp compare;
205 typedef ci::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
206 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
207 test_rcu<set_type, hash_type::make>(4, 3);
209 typedef ci::MultiLevelHashSet<
212 typename ci::multilevel_hashset::make_traits<
213 ci::multilevel_hashset::hash_accessor< get_hash<hash_type>>
214 , ci::opt::disposer< item_disposer >
215 , co::stat< ci::multilevel_hashset::stat<>>
216 , co::less< hash_type::less >
217 , co::compare< hash128::cmp >
220 test_rcu<set_type2, hash_type::make>(4, 3);