Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorUlrich Germann <Ulrich.Germann@gmail.com>2015-05-21 01:46:01 +0300
committerUlrich Germann <Ulrich.Germann@gmail.com>2015-05-21 01:46:01 +0300
commit044bfd0b1a91d59d5a401777433e5e0fd472193e (patch)
tree18256746e074965062673c8c45a7344a7cba8939 /util
parentd8406e3f510fa7bce3b6c7ad94beda309dbdb176 (diff)
util/probing_hash_table_benchmark_main.cc wouldn't compile with boost v.1.46.1.
Diffstat (limited to 'util')
-rw-r--r--util/probing_hash_table_benchmark_main.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/probing_hash_table_benchmark_main.cc b/util/probing_hash_table_benchmark_main.cc
index 3e12290cf..9deeaac2d 100644
--- a/util/probing_hash_table_benchmark_main.cc
+++ b/util/probing_hash_table_benchmark_main.cc
@@ -1,9 +1,18 @@
+
#include "util/probing_hash_table.hh"
#include "util/scoped.hh"
#include "util/usage.hh"
#include <boost/random/mersenne_twister.hpp>
+#include <boost/version.hpp>
+#if BOOST_VERSION / 100000 < 1
+#error BOOST_LIB_VERSION is to old. Time to upgrade.
+#elif BOOST_VERSION / 100000 > 1 || BOOST_VERSION / 100 % 1000 > 46
#include <boost/random/uniform_int_distribution.hpp>
+#define have_uniform_int_distribution
+#else
+#include <boost/random/uniform_int.hpp>
+#endif
#include <iostream>
@@ -22,8 +31,13 @@ void Test(uint64_t entries, uint64_t lookups, float multiplier = 1.5) {
std::size_t size = Table::Size(entries, multiplier);
scoped_malloc backing(util::CallocOrThrow(size));
Table table(backing.get(), size);
+#ifdef have_uniform_int_distribution
boost::random::mt19937 gen;
boost::random::uniform_int_distribution<> dist(std::numeric_limits<uint64_t>::min(), std::numeric_limits<uint64_t>::max());
+#else
+ boost::mt19937 gen;
+ boost::uniform_int<> dist(std::numeric_limits<uint64_t>::min(), std::numeric_limits<uint64_t>::max());
+#endif
double start = UserTime();
for (uint64_t i = 0; i < entries; ++i) {
Entry entry;