Skip to content

Commit

Permalink
Fix broken 64bit hash in tbb
Browse files Browse the repository at this point in the history
Fixes #181
  • Loading branch information
jlblancoc committed Dec 10, 2019
1 parent 60d820e commit 0c0b9db
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gtsam/base/ConcurrentMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@
# undef max
# undef ERROR

#include <functional> // std::hash()

// Use TBB concurrent_unordered_map for ConcurrentMap
# define CONCURRENT_MAP_BASE tbb::concurrent_unordered_map<KEY, VALUE>
template <typename KEY, typename VALUE>
using CONCURRENT_MAP_BASE = tbb::concurrent_unordered_map<
KEY,
VALUE,
std::hash<KEY>
>;

#else

// If we're not using TBB, use a FastMap for ConcurrentMap
# include <gtsam/base/FastMap.h>
# define CONCURRENT_MAP_BASE gtsam::FastMap<KEY, VALUE>
#include <gtsam/base/FastMap.h>
template <typename KEY, typename VALUE>
using CONCURRENT_MAP_BASE = gtsam::FastMap<KEY, VALUE>

#endif

Expand Down

0 comments on commit 0c0b9db

Please sign in to comment.