X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=blobdiff_plain;f=test%2Fstress%2Fmap%2Fmap_type_feldman_hashmap.h;h=c6026064fbf6107a9d5041cb420ec703e6d0d75b;hp=fa5e947997307096e5c8a36ec0826032b369fa09;hb=755e340bdd34d88c52e7aa4f1b08395c3cdca816;hpb=7608a8af82155af52e45fda01cc6e46a0db97793 diff --git a/test/stress/map/map_type_feldman_hashmap.h b/test/stress/map/map_type_feldman_hashmap.h index fa5e9479..c6026064 100644 --- a/test/stress/map/map_type_feldman_hashmap.h +++ b/test/stress/map/map_type_feldman_hashmap.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_MAP_TYPE_FELDMAN_HASHMAP_H @@ -47,6 +47,12 @@ namespace map { { typedef cc::FeldmanHashMap< GC, Key, T, Traits > base_class; public: + + template + struct rebind_traits { + typedef FeldmanHashMap result; + }; + template FeldmanHashMap( Config const& cfg) : base_class( cfg.s_nFeldmanMap_HeadBits, cfg.s_nFeldmanMap_ArrayBits ) @@ -69,7 +75,8 @@ namespace map { struct traits_FeldmanHashMap_stdhash : public cc::feldman_hashmap::traits { - typedef std::hash< Key > hash; + typedef std::hash< Key > hash; + typedef std::less less; }; typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stdhash > FeldmanHashMap_hp_stdhash; @@ -85,6 +92,7 @@ namespace map { struct traits_FeldmanHashMap_stdhash_stat: traits_FeldmanHashMap_stdhash { typedef cc::feldman_hashmap::stat<> stat; + typedef std::less less; }; typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stdhash_stat > FeldmanHashMap_hp_stdhash_stat; @@ -160,28 +168,33 @@ namespace map { // for fixed-sized keys - no hash functor required - typedef FeldmanHashMap< cds::gc::HP, Key, Value > FeldmanHashMap_hp_fixed; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value > FeldmanHashMap_dhp_fixed; - typedef FeldmanHashMap< rcu_gpi, Key, Value > FeldmanHashMap_rcu_gpi_fixed; - typedef FeldmanHashMap< rcu_gpb, Key, Value > FeldmanHashMap_rcu_gpb_fixed; - typedef FeldmanHashMap< rcu_gpt, Key, Value > FeldmanHashMap_rcu_gpt_fixed; + struct traits_FeldmanHashMap_fixed: public cc::feldman_hashmap::traits + { + typedef map::cmp compare; + }; + + typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_hp_fixed; + typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_dhp_fixed; + typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_gpi_fixed; + typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_gpb_fixed; + typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_gpt_fixed; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value > FeldmanHashMap_rcu_shb_fixed; - typedef FeldmanHashMap< rcu_sht, Key, Value > FeldmanHashMap_rcu_sht_fixed; + typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_shb_fixed; + typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_fixed > FeldmanHashMap_rcu_sht_fixed; #endif - struct traits_FeldmanHashMap_stat : public cc::feldman_hashmap::traits + struct traits_FeldmanHashMap_fixed_stat : public traits_FeldmanHashMap_fixed { typedef cc::feldman_hashmap::stat<> stat; }; - typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_hp_fixed_stat; - typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_dhp_fixed_stat; - typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpi_fixed_stat; - typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpb_fixed_stat; - typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_gpt_fixed_stat; + typedef FeldmanHashMap< cds::gc::HP, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_hp_fixed_stat; + typedef FeldmanHashMap< cds::gc::DHP, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_dhp_fixed_stat; + typedef FeldmanHashMap< rcu_gpi, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_gpi_fixed_stat; + typedef FeldmanHashMap< rcu_gpb, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_gpb_fixed_stat; + typedef FeldmanHashMap< rcu_gpt, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_gpt_fixed_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED - typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_shb_fixed_stat; - typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_stat > FeldmanHashMap_rcu_sht_fixed_stat; + typedef FeldmanHashMap< rcu_shb, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_shb_fixed_stat; + typedef FeldmanHashMap< rcu_sht, Key, Value, traits_FeldmanHashMap_fixed_stat > FeldmanHashMap_rcu_sht_fixed_stat; #endif }; @@ -218,24 +231,28 @@ namespace map { CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_stdhash_stat, key_type, value_type ) \ # if CDS_BUILD_BITS == 64 -# define CDSSTRESS_FeldmanHashMap_city_SHRCU( fixture, test_case, key_type, value_type ) \ +# define CDSSTRESS_FeldmanHashMap_city64_SHRCU( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_shb_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_city64, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_shb_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_city64_stat, key_type, value_type ) \ + +# define CDSSTRESS_FeldmanHashMap_city128_SHRCU( fixture, test_case, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_shb_city64, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_city64, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_shb_city64_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_city64_stat, key_type, value_type ) \ - CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_shb_city128, key_type, value_type ) \ - CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_city128, key_type, value_type ) \ - CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_shb_city128_stat, key_type, value_type ) \ - CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_sht_city128_stat, key_type, value_type ) \ # else -# define CDSSTRESS_FeldmanHashMap_city_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashMap_city64_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashMap_city128_SHRCU( fixture, test_case, key_type, value_type ) # endif #else # define CDSSTRESS_FeldmanHashMap_fixed_SHRCU( fixture, test_case, key_type, value_type ) # define CDSSTRESS_FeldmanHashMap_stdhash_SHRCU( fixture, test_case, key_type, value_type ) -# define CDSSTRESS_FeldmanHashMap_city_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashMap_city64_SHRCU( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashMap_city128_SHRCU( fixture, test_case, key_type, value_type ) #endif #define CDSSTRESS_FeldmanHashMap_fixed( fixture, test_case, key_type, value_type ) \ @@ -266,7 +283,7 @@ namespace map { #if CDS_BUILD_BITS == 64 -# define CDSSTRESS_FeldmanHashMap_city( fixture, test_case, key_type, value_type ) \ +# define CDSSTRESS_FeldmanHashMap_city64( fixture, test_case, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_hp_city64, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_dhp_city64, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpi_city64, key_type, value_type ) \ @@ -277,6 +294,9 @@ namespace map { CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpi_city64_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpb_city64_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpt_city64_stat, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_city64_SHRCU( fixture, test_case, key_type, value_type ) + +# define CDSSTRESS_FeldmanHashMap_city128( fixture, test_case, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_hp_city128, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_dhp_city128, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpi_city128, key_type, value_type ) \ @@ -287,9 +307,15 @@ namespace map { CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpi_city128_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpb_city128_stat, key_type, value_type ) \ CDSSTRESS_FeldmanHashMap_case( fixture, test_case, FeldmanHashMap_rcu_gpt_city128_stat, key_type, value_type ) \ - CDSSTRESS_FeldmanHashMap_city_SHRCU( fixture, test_case, key_type, value_type ) + CDSSTRESS_FeldmanHashMap_city128_SHRCU( fixture, test_case, key_type, value_type ) + +# define CDSSTRESS_FeldmanHashMap_city( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_city64( fixture, test_case, key_type, value_type ) \ + CDSSTRESS_FeldmanHashMap_city128( fixture, test_case, key_type, value_type ) #else +# define CDSSTRESS_FeldmanHashMap_city64( fixture, test_case, key_type, value_type ) +# define CDSSTRESS_FeldmanHashMap_city128( fixture, test_case, key_type, value_type ) # define CDSSTRESS_FeldmanHashMap_city( fixture, test_case, key_type, value_type ) #endif