mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 08:34:39 +08:00
serialize.cc example doesn't seem to work with cereal #116
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
#include <cinttypes>
|
||||
#include "parallel_hashmap/phmap_dump.h"
|
||||
|
||||
#define USE_CEREAL 0
|
||||
|
||||
#if USE_CEREAL
|
||||
#define PHMAP_DISABLE_DUMP // this is needed because the cereal doesn't like our hash map to have a dump() function
|
||||
|
||||
#include "cereal/types/unordered_map.hpp"
|
||||
#include "cereal/types/memory.hpp"
|
||||
#include "cereal/types/bitset.hpp"
|
||||
#include "cereal/archives/binary.hpp"
|
||||
#include <fstream>
|
||||
#endif
|
||||
|
||||
#include "parallel_hashmap/phmap_dump.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
#include <cstdio>
|
||||
|
||||
Vendored
+2
-2
@@ -1576,7 +1576,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PHMAP_NON_DETERMINISTIC
|
||||
#if !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP)
|
||||
template<typename OutputArchive>
|
||||
bool dump(OutputArchive&) const;
|
||||
|
||||
@@ -3366,7 +3366,7 @@ public:
|
||||
return HashElement{hash_ref()}(key);
|
||||
}
|
||||
|
||||
#ifndef PHMAP_NON_DETERMINISTIC
|
||||
#if !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP)
|
||||
template<typename OutputArchive>
|
||||
bool dump(OutputArchive& ar) const;
|
||||
|
||||
|
||||
Vendored
+5
@@ -42,6 +42,8 @@ struct IsTriviallyCopyable<std::pair<T1, T2>> {
|
||||
|
||||
namespace priv {
|
||||
|
||||
#if !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP)
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// dump/load for raw_hash_set
|
||||
// ------------------------------------------------------------------------
|
||||
@@ -166,6 +168,9 @@ bool parallel_hash_set<N, RefSet, Mtx_, Policy, Hash, Eq, Alloc>::load(InputArch
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // !defined(PHMAP_NON_DETERMINISTIC) && !defined(PHMAP_DISABLE_DUMP)
|
||||
|
||||
} // namespace priv
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user