3 #include "set/hdr_multilevel_hashset.h"
4 #include <cds/urcu/general_buffered.h>
5 #include <cds/container/multilevel_hashset_rcu.h>
6 #include "unit/print_multilevel_hashset_stat.h"
10 typedef cds::urcu::gc<cds::urcu::general_buffered<>> rcu_type;
13 void MultiLevelHashSetHdrTest::rcu_gpb_stdhash()
15 typedef size_t hash_type;
17 struct traits: public cc::multilevel_hashset::traits
19 typedef get_hash<hash_type> hash_accessor;
21 typedef cc::MultiLevelHashSet< rcu_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_rcu<set_type, std::hash<hash_type>>(4, 2);
25 typedef cc::MultiLevelHashSet<
28 typename cc::multilevel_hashset::make_traits<
29 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
32 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
35 void MultiLevelHashSetHdrTest::rcu_gpb_hash128()
37 typedef hash128 hash_type;
39 struct traits: public cc::multilevel_hashset::traits
41 typedef get_hash<hash_type> hash_accessor;
42 typedef hash128::less less;
44 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
45 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash128!!!" );
46 test_rcu<set_type, hash128::make>(4, 2);
48 typedef cc::MultiLevelHashSet<
51 typename cc::multilevel_hashset::make_traits<
52 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
53 , co::less< hash_type::less >
56 test_rcu<set_type2, hash128::make>(4, 2);
59 void MultiLevelHashSetHdrTest::rcu_gpb_stdhash_stat()
61 typedef size_t hash_type;
63 struct traits: public cc::multilevel_hashset::traits
65 typedef get_hash<hash_type> hash_accessor;
66 typedef cc::multilevel_hashset::stat<> stat;
68 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
69 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
70 test_rcu<set_type, std::hash<hash_type>>(4, 2);
72 typedef cc::MultiLevelHashSet<
75 typename cc::multilevel_hashset::make_traits<
76 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
77 ,co::stat< cc::multilevel_hashset::stat<>>
80 test_rcu<set_type2, std::hash<hash_type>>(4, 2);
83 void MultiLevelHashSetHdrTest::rcu_gpb_hash128_stat()
85 typedef hash128 hash_type;
87 struct traits: public cc::multilevel_hashset::traits
89 typedef get_hash<hash_type> hash_accessor;
90 typedef hash128::cmp compare;
91 typedef cc::multilevel_hashset::stat<> stat;
93 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
94 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
95 test_rcu<set_type, hash_type::make>(4, 2);
97 typedef cc::MultiLevelHashSet<
100 typename cc::multilevel_hashset::make_traits<
101 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
102 ,co::stat< cc::multilevel_hashset::stat<>>
103 ,co::compare< hash128::cmp >
106 test_rcu<set_type2, hash_type::make>(4, 2);
109 void MultiLevelHashSetHdrTest::rcu_gpb_stdhash_5_3()
111 typedef size_t hash_type;
113 struct traits: public cc::multilevel_hashset::traits
115 typedef get_hash<hash_type> hash_accessor;
117 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
118 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
119 test_rcu<set_type, std::hash<hash_type>>(5, 3);
121 typedef cc::MultiLevelHashSet<
124 typename cc::multilevel_hashset::make_traits<
125 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
128 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
131 void MultiLevelHashSetHdrTest::rcu_gpb_hash128_4_3()
133 typedef hash128 hash_type;
135 struct traits: public cc::multilevel_hashset::traits
137 typedef get_hash<hash_type> hash_accessor;
138 typedef co::v::sequential_consistent memory_model;
140 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
141 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
142 test_rcu<set_type, hash128::make >(4, 3);
144 typedef cc::MultiLevelHashSet<
147 typename cc::multilevel_hashset::make_traits<
148 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
149 ,co::memory_model< co::v::sequential_consistent >
152 test_rcu<set_type2, hash128::make >(4, 3);
155 void MultiLevelHashSetHdrTest::rcu_gpb_stdhash_5_3_stat()
157 typedef size_t hash_type;
159 struct traits: public cc::multilevel_hashset::traits
161 typedef get_hash<hash_type> hash_accessor;
162 typedef cc::multilevel_hashset::stat<> stat;
164 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
165 static_assert(std::is_same< typename set_type::hash_type, size_t>::value, "set::hash_type != size_t!!!" );
166 test_rcu<set_type, std::hash<hash_type>>(5, 3);
168 typedef cc::MultiLevelHashSet<
171 typename cc::multilevel_hashset::make_traits<
172 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
173 ,co::stat< cc::multilevel_hashset::stat<>>
176 test_rcu<set_type2, std::hash<hash_type>>(5, 3);
179 void MultiLevelHashSetHdrTest::rcu_gpb_hash128_4_3_stat()
181 typedef hash128 hash_type;
183 struct traits: public cc::multilevel_hashset::traits
185 typedef get_hash<hash_type> hash_accessor;
186 typedef cc::multilevel_hashset::stat<> stat;
187 typedef hash128::less less;
188 typedef hash128::cmp compare;
190 typedef cc::MultiLevelHashSet< rcu_type, Item<hash_type>, traits > set_type;
191 static_assert(std::is_same< typename set_type::hash_type, hash_type>::value, "set::hash_type != hash_type!!!" );
192 test_rcu<set_type, hash_type::make>(4, 3);
194 typedef cc::MultiLevelHashSet<
197 typename cc::multilevel_hashset::make_traits<
198 cc::multilevel_hashset::hash_accessor< get_hash<hash_type>>
199 , co::stat< cc::multilevel_hashset::stat<>>
200 , co::less< hash_type::less >
201 , co::compare< hash128::cmp >
204 test_rcu<set_type2, hash_type::make>(4, 3);