3 #include "map/hdr_feldman_hashmap.h"
4 #include <cds/urcu/general_buffered.h>
5 #include <cds/container/feldman_hashmap_rcu.h>
6 #include "unit/print_feldman_hashset_stat.h"
10 typedef cds::urcu::gc< cds::urcu::general_buffered<>> rcu_type;
13 void FeldmanHashMapHdrTest::rcu_gpb_nohash()
15 typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
17 test_rcu<map_type>(4, 2);
20 void FeldmanHashMapHdrTest::rcu_gpb_stdhash()
22 struct traits : public cc::feldman_hashmap::traits {
23 typedef std::hash<size_t> hash;
25 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
27 test_rcu<map_type>(4, 2);
30 void FeldmanHashMapHdrTest::rcu_gpb_hash128()
32 struct traits : public cc::feldman_hashmap::traits {
33 typedef hash128::make hash;
34 typedef hash128::less less;
36 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
37 test_rcu<map_type>(4, 2);
39 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
40 typename cc::feldman_hashmap::make_traits<
41 co::hash< hash128::make >
42 , co::less< hash128::less >
45 test_rcu<map_type2>(4, 2);
48 void FeldmanHashMapHdrTest::rcu_gpb_nohash_stat()
50 struct traits : public cc::feldman_hashmap::traits {
51 typedef cc::feldman_hashmap::stat<> stat;
53 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
54 test_rcu<map_type>(4, 2);
56 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
57 typename cc::feldman_hashmap::make_traits<
58 co::stat< cc::feldman_hashmap::stat<>>
61 test_rcu<map_type2>(4, 2);
64 void FeldmanHashMapHdrTest::rcu_gpb_stdhash_stat()
66 struct traits : public cc::feldman_hashmap::traits {
67 typedef std::hash<size_t> hash;
68 typedef cc::feldman_hashmap::stat<> stat;
70 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
71 test_rcu<map_type>(4, 2);
73 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
74 typename cc::feldman_hashmap::make_traits<
75 co::stat< cc::feldman_hashmap::stat<>>
76 ,co::hash<std::hash<size_t>>
79 test_rcu<map_type2>(4, 2);
82 void FeldmanHashMapHdrTest::rcu_gpb_hash128_stat()
84 struct traits : public cc::feldman_hashmap::traits {
85 typedef cc::feldman_hashmap::stat<> stat;
86 typedef hash128::make hash;
87 typedef hash128::cmp compare;
89 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
90 test_rcu<map_type>(4, 2);
92 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
93 typename cc::feldman_hashmap::make_traits<
94 co::stat< cc::feldman_hashmap::stat<>>
95 , co::hash< hash128::make >
96 , co::compare< hash128::cmp >
99 test_rcu<map_type2>(4, 2);
102 void FeldmanHashMapHdrTest::rcu_gpb_nohash_5_3()
104 typedef cc::FeldmanHashMap< rcu_type, size_t, Item > map_type;
106 test_rcu<map_type>(5, 3);
109 void FeldmanHashMapHdrTest::rcu_gpb_stdhash_5_3()
111 struct traits : public cc::feldman_hashmap::traits {
112 typedef std::hash<size_t> hash;
114 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
116 test_rcu<map_type>(5, 3);
119 void FeldmanHashMapHdrTest::rcu_gpb_nohash_5_3_stat()
121 struct traits : public cc::feldman_hashmap::traits {
122 typedef cc::feldman_hashmap::stat<> stat;
123 typedef cds::backoff::empty back_off;
125 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
126 test_rcu<map_type>(5, 3);
128 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
129 typename cc::feldman_hashmap::make_traits<
130 co::stat< cc::feldman_hashmap::stat<>>
131 , co::back_off< cds::backoff::empty >
134 test_rcu<map_type2>(5, 3);
137 void FeldmanHashMapHdrTest::rcu_gpb_stdhash_5_3_stat()
139 struct traits : public cc::feldman_hashmap::traits {
140 typedef cc::feldman_hashmap::stat<> stat;
141 typedef cds::backoff::empty back_off;
142 typedef std::hash<size_t> hash;
144 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
145 test_rcu<map_type>(5, 3);
147 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
148 typename cc::feldman_hashmap::make_traits<
149 co::stat< cc::feldman_hashmap::stat<>>
150 ,co::back_off< cds::backoff::empty >
151 ,co::hash< std::hash<size_t>>
154 test_rcu<map_type2>(5, 3);
157 void FeldmanHashMapHdrTest::rcu_gpb_hash128_4_3()
159 struct traits : public cc::feldman_hashmap::traits {
160 typedef hash128::make hash;
161 typedef hash128::less less;
163 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
164 test_rcu<map_type>(4, 3);
166 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
167 typename cc::feldman_hashmap::make_traits<
168 co::hash< hash128::make >
169 , co::less< hash128::less >
172 test_rcu<map_type2>(4, 3);
175 void FeldmanHashMapHdrTest::rcu_gpb_hash128_4_3_stat()
177 struct traits : public cc::feldman_hashmap::traits {
178 typedef hash128::make hash;
179 typedef hash128::less less;
180 typedef cc::feldman_hashmap::stat<> stat;
181 typedef co::v::sequential_consistent memory_model;
183 typedef cc::FeldmanHashMap< rcu_type, size_t, Item, traits > map_type;
184 test_rcu<map_type>(4, 3);
186 typedef cc::FeldmanHashMap< rcu_type, size_t, Item,
187 typename cc::feldman_hashmap::make_traits<
188 co::hash< hash128::make >
189 , co::less< hash128::less >
190 , co::stat< cc::feldman_hashmap::stat<>>
191 , co::memory_model< co::v::sequential_consistent >
194 test_rcu<map_type2>(4, 3);