27 #ifndef LBANN_UTILS_SERIALIZATION_CEREAL_UTILS_HPP_ 28 #define LBANN_UTILS_SERIALIZATION_CEREAL_UTILS_HPP_ 30 #include "lbann_config.hpp" 32 #include <cereal/cereal.hpp> 34 #ifdef LBANN_HAS_CEREAL_BINARY_ARCHIVES 35 #include <cereal/archives/binary.hpp> 36 #endif // LBANN_HAS_CEREAL_BINARY_ARCHIVES 37 #ifdef LBANN_HAS_CEREAL_JSON_ARCHIVES // Not yet supported 38 #include <cereal/archives/json.hpp> 39 #endif // LBANN_HAS_CEREAL_JSON_ARCHIVES 40 #ifdef LBANN_HAS_CEREAL_PORTABLE_BINARY_ARCHIVES // Not yet supported 41 #include <cereal/archives/portable_binary.hpp> 42 #endif // LBANN_HAS_CEREAL_PORTABLE_BINARY_ARCHIVES 43 #ifdef LBANN_HAS_CEREAL_XML_ARCHIVES 44 #include <cereal/archives/xml.hpp> 45 #endif // LBANN_HAS_CEREAL_XML_ARCHIVES 47 #include <cereal/details/traits.hpp> 49 #include <cereal/types/base_class.hpp> 50 #include <cereal/types/map.hpp> 51 #include <cereal/types/polymorphic.hpp> 52 #include <cereal/types/set.hpp> 53 #include <cereal/types/string.hpp> 54 #include <cereal/types/unordered_map.hpp> 55 #include <cereal/types/unordered_set.hpp> 56 #include <cereal/types/utility.hpp> 57 #include <cereal/types/vector.hpp> 59 #include <h2/meta/Core.hpp> 60 #include <h2/meta/TypeList.hpp> 62 #if !(defined __CUDACC__) 66 using namespace ::cereal::traits;
74 template <
typename ArchiveT>
77 #if !(defined DOXYGEN_SHOULD_SKIP_THIS) 79 template <
typename ArchiveT>
85 #ifdef LBANN_HAS_CEREAL_BINARY_ARCHIVES 94 #endif // LBANN_HAS_CEREAL_BINARY_ARCHIVES 96 #ifdef LBANN_HAS_CEREAL_JSON_ARCHIVES 105 #endif // LBANN_HAS_CEREAL_JSON_ARCHIVES 107 #ifdef LBANN_HAS_CEREAL_PORTABLE_BINARY_ARCHIVES 116 #endif // LBANN_HAS_CEREAL_PORTABLE_BINARY_ARCHIVES 118 #ifdef LBANN_HAS_CEREAL_XML_ARCHIVES 127 #endif // LBANN_HAS_CEREAL_XML_ARCHIVES 128 #endif // defined DOXYGEN_SHOULD_SKIP_THIS 134 template <
typename ArchiveT>
140 template <
typename ArchiveT>
146 template <
typename ArchiveT>
148 std::is_base_of_v<cereal::detail::InputArchiveBase, ArchiveT>;
153 template <
typename ArchiveT>
155 std::is_base_of_v<cereal::detail::OutputArchiveBase, ArchiveT>;
160 template <
typename ArchiveT,
typename ResultT =
int>
162 EnableWhen<IsTextArchive<ArchiveT> && IsBuiltinArchive<ArchiveT>, ResultT>;
167 template <
typename ArchiveT,
typename ResultT =
int>
169 EnableWhen<!IsTextArchive<ArchiveT> && IsBuiltinArchive<ArchiveT>, ResultT>;
173 #endif // !(defined __CUDACC__ || defined __HIPCC__) 174 #endif // LBANN_UTILS_SERIALIZATION_CEREAL_UTILS_HPP_ constexpr bool IsOutputArchive
Variable template for checking that an archive type is an "Output" archive.
EnableWhen<!IsTextArchive< ArchiveT > &&IsBuiltinArchive< ArchiveT >, ResultT > WhenNotTextArchive
SFINAE helper for splitting text-based and non-text-based serialization functions.
constexpr bool IsBuiltinArchive
Variable template for checking that an archive is a default Cereal archive type.
Predicate for testing if the given type is a built-in Cereal archive.
constexpr bool IsInputArchive
Variable template for checking that an archive type is an "Input" archive.
EnableWhen< IsTextArchive< ArchiveT > &&IsBuiltinArchive< ArchiveT >, ResultT > WhenTextArchive
SFINAE helper for splitting text-based and non-text-based serialization functions.
constexpr bool IsTextArchive
Variable template for checking that an archive type is marked as a text archive in Cereal...