serialize.cc example doesn't seem to work with cereal #116

This commit is contained in:
greg
2021-11-09 21:32:08 -05:00
parent 28bba43492
commit 07b740bd99
3 changed files with 12 additions and 3 deletions
+5 -1
View File
@@ -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>
+2 -2
View File
@@ -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;
+5
View File
@@ -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