//#include "config.h"
#include "city.h"
+#if CDS_BUILD_BITS == 64
#include <algorithm>
#include <string.h> // for memcpy and memset
}
#endif
+#endif // #if CDS_BUILD_BITS == 64
#ifndef CITY_HASH_H_
#define CITY_HASH_H_
+#include <cds/details/defs.h>
+#if CDS_BUILD_BITS == 64
+
#include <stdlib.h> // for size_t.
#include <stdint.h>
#include <utility>
return b;
}
+#endif // #if CDS_BUILD_BITS == 64
#endif // CITY_HASH_H_
#ifndef CDSUNIT_HASH_FUNC_H
#define CDSUNIT_HASH_FUNC_H
+#include <cds/details/defs.h>
+
#include "hashing/sha256.h"
#include "hashing/md5.h"
-#include "hashing/city.h"
+#if CDS_BUILD_BITS == 64
+# include "hashing/city.h"
+#endif
namespace hashing {
typedef hasher<SHA256> sha256;
typedef hasher<MD5> md5;
+#if CDS_BUILD_BITS == 64
class city32 {
public:
typedef uint32_t hash_type;
}
};
};
+#endif // #if CDS_BUILD_BITS == 64
+
} // namespace hashing
// **************************************************************************************
// MultiLevelHashMap
+#undef CDSUNIT_DECLARE_MultiLevelHashMap64
+#if CDS_BUILD_BITS == 64
+# define CDSUNIT_DECLARE_MultiLevelHashMap64 \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city64) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city64_stat) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city64) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city64_stat) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city128) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city128_stat) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city128) \
+ TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city128_stat)
+#else
+# define CDSUNIT_DECLARE_MultiLevelHashMap64
+#endif
+
#undef CDSUNIT_DECLARE_MultiLevelHashMap
#define CDSUNIT_DECLARE_MultiLevelHashMap \
TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_stdhash) \
TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_sha256_stat) \
TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_sha256) \
TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_sha256_stat) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city64) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city64_stat) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city64) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city64_stat) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city128) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_hp_city128_stat) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city128) \
- TEST_CASE(tag_MultiLevelHashMap, MultiLevelHashMap_dhp_city128_stat) \
-
+ CDSUNIT_DECLARE_MultiLevelHashMap64
+
+
+#undef CDSUNIT_TEST_MultiLevelHashMap64
+#if CDS_BUILD_BITS == 64
+# define CDSUNIT_TEST_MultiLevelHashMap64 \
+ CPPUNIT_TEST(MultiLevelHashMap_hp_city64) \
+ CPPUNIT_TEST(MultiLevelHashMap_hp_city64_stat) \
+ CPPUNIT_TEST(MultiLevelHashMap_dhp_city64) \
+ CPPUNIT_TEST(MultiLevelHashMap_dhp_city64_stat) \
+ CPPUNIT_TEST(MultiLevelHashMap_hp_city128) \
+ CPPUNIT_TEST(MultiLevelHashMap_hp_city128_stat) \
+ CPPUNIT_TEST(MultiLevelHashMap_dhp_city128) \
+ CPPUNIT_TEST(MultiLevelHashMap_dhp_city128_stat)
+#else
+# define CDSUNIT_TEST_MultiLevelHashMap64
+#endif
#undef CDSUNIT_TEST_MultiLevelHashMap
#define CDSUNIT_TEST_MultiLevelHashMap \
CPPUNIT_TEST(MultiLevelHashMap_hp_sha256_stat) \
CPPUNIT_TEST(MultiLevelHashMap_dhp_sha256) \
CPPUNIT_TEST(MultiLevelHashMap_dhp_sha256_stat) \
- CPPUNIT_TEST(MultiLevelHashMap_hp_city64) \
- CPPUNIT_TEST(MultiLevelHashMap_hp_city64_stat) \
- CPPUNIT_TEST(MultiLevelHashMap_dhp_city64) \
- CPPUNIT_TEST(MultiLevelHashMap_dhp_city64_stat) \
- CPPUNIT_TEST(MultiLevelHashMap_hp_city128) \
- CPPUNIT_TEST(MultiLevelHashMap_hp_city128_stat) \
- CPPUNIT_TEST(MultiLevelHashMap_dhp_city128) \
- CPPUNIT_TEST(MultiLevelHashMap_dhp_city128_stat) \
+ CDSUNIT_TEST_MultiLevelHashMap64
typedef MultiLevelHashMap< cds::gc::DHP, Key, Value, traits_MultiLevelHashMap_md5_stat > MultiLevelHashMap_dhp_md5_stat;
// CityHash
+#if CDS_BUILD_BITS == 64
struct traits_MultiLevelHashMap_city64 : public cc::multilevel_hashmap::traits
{
typedef ::hashing::city64 hash;
};
typedef MultiLevelHashMap< cds::gc::HP, Key, Value, traits_MultiLevelHashMap_city128_stat > MultiLevelHashMap_hp_city128_stat;
typedef MultiLevelHashMap< cds::gc::DHP, Key, Value, traits_MultiLevelHashMap_city128_stat > MultiLevelHashMap_dhp_city128_stat;
-
+#endif // CDS_BUILD_BITS == 64
};
template <typename GC, typename K, typename T, typename Traits >
//***********************************************
// MultiLevelHashSet
+#undef CDSUNIT_DECLARE_MultiLevelHashSet64
+#if CDS_BUILD_BITS == 64
+# define CDSUNIT_DECLARE_MultiLevelHashSet64 \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city64) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city64_stat) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city64) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city64_stat) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city128) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city128_stat) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city128) \
+ TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city128_stat)
+#else
+# define CDSUNIT_DECLARE_MultiLevelHashSet64
+#endif
+
#undef CDSUNIT_DECLARE_MultiLevelHashSet
#define CDSUNIT_DECLARE_MultiLevelHashSet \
TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_stdhash) \
TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_sha256_stat) \
TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_sha256) \
TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_sha256_stat) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city64) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city64_stat) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city64) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city64_stat) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city128) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_hp_city128_stat) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city128) \
- TEST_CASE(tag_MultiLevelHashSet, MultiLevelHashSet_dhp_city128_stat)
+ CDSUNIT_DECLARE_MultiLevelHashSet64
+#undef CDSUNIT_TEST_MultiLevelHashSet64
+#if CDS_BUILD_BITS == 64
+# define CDSUNIT_TEST_MultiLevelHashSet64 \
+ CPPUNIT_TEST(MultiLevelHashSet_hp_city64) \
+ CPPUNIT_TEST(MultiLevelHashSet_hp_city64_stat) \
+ CPPUNIT_TEST(MultiLevelHashSet_dhp_city64) \
+ CPPUNIT_TEST(MultiLevelHashSet_dhp_city64_stat) \
+ CPPUNIT_TEST(MultiLevelHashSet_hp_city128) \
+ CPPUNIT_TEST(MultiLevelHashSet_hp_city128_stat) \
+ CPPUNIT_TEST(MultiLevelHashSet_dhp_city128) \
+ CPPUNIT_TEST(MultiLevelHashSet_dhp_city128_stat)
+#else
+# define CDSUNIT_TEST_MultiLevelHashSet64
+#endif
#undef CDSUNIT_TEST_MultiLevelHashSet
#define CDSUNIT_TEST_MultiLevelHashSet \
CPPUNIT_TEST(MultiLevelHashSet_hp_sha256_stat) \
CPPUNIT_TEST(MultiLevelHashSet_dhp_sha256) \
CPPUNIT_TEST(MultiLevelHashSet_dhp_sha256_stat) \
- CPPUNIT_TEST(MultiLevelHashSet_hp_city64) \
- CPPUNIT_TEST(MultiLevelHashSet_hp_city64_stat) \
- CPPUNIT_TEST(MultiLevelHashSet_dhp_city64) \
- CPPUNIT_TEST(MultiLevelHashSet_dhp_city64_stat) \
- CPPUNIT_TEST(MultiLevelHashSet_hp_city128) \
- CPPUNIT_TEST(MultiLevelHashSet_hp_city128_stat) \
- CPPUNIT_TEST(MultiLevelHashSet_dhp_city128) \
- CPPUNIT_TEST(MultiLevelHashSet_dhp_city128_stat)
-
+ CDSUNIT_TEST_MultiLevelHashSet64
typedef MultiLevelHashSet< cds::gc::DHP, key_val<::hashing::md5>, traits_MultiLevelHashSet_md5_stat > MultiLevelHashSet_dhp_md5_stat;
// CityHash
+#if CDS_BUILD_BITS == 64
struct traits_MultiLevelHashSet_city64 : public default_traits
{
typedef ::hashing::city64::less less;
};
typedef MultiLevelHashSet< cds::gc::HP, key_val<::hashing::city128>, traits_MultiLevelHashSet_city128_stat > MultiLevelHashSet_hp_city128_stat;
typedef MultiLevelHashSet< cds::gc::DHP, key_val<::hashing::city128>, traits_MultiLevelHashSet_city128_stat > MultiLevelHashSet_dhp_city128_stat;
+#endif // #if CDS_BUILD_BITS == 64
};
template <typename GC, typename T, typename Traits >