timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
serialization.cpp
Go to the documentation of this file.
1// MIT License
2//
3// Copyright (c) 2020, The Regents of the University of California,
4// through Lawrence Berkeley National Laboratory (subject to receipt of any
5// required approvals from the U.S. Dept. of Energy). All rights reserved.
6//
7// Permission is hereby granted, free of charge, to any person obtaining a copy
8// of this software and associated documentation files (the "Software"), to deal
9// in the Software without restriction, including without limitation the rights
10// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11// copies of the Software, and to permit persons to whom the Software is
12// furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in all
15// copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23// SOFTWARE.
24
25#ifndef TIMEMORY_OPERATIONS_TYPES_SERIALIZATION_CPP_
26#define TIMEMORY_OPERATIONS_TYPES_SERIALIZATION_CPP_ 1
27
28#if !defined(TIMEMORY_OPERATIONS_TYPES_SERIALIZATION_HPP_)
30
31# include "timemory/tpls/cereal/archives.hpp"
32#endif
33
34namespace tim
35{
36namespace operation
37{
38namespace internal
39{
40template <typename Tp>
42 cereal::MinimalJSONOutputArchive& ar,
43 const unsigned int version, ...)
44{
45 impl(obj, ar, version);
46}
47
48template <typename Tp>
49void
50serialization<Tp, true>::operator()(const Tp& obj, cereal::MinimalJSONOutputArchive& ar,
51 const unsigned int version, ...) const
52{
53 impl(obj, ar, version);
54}
55
56template <typename Tp>
57void
58serialization<Tp, true>::operator()(cereal::MinimalJSONOutputArchive& ar, metadata,
59 ...) const
60{
61 impl(ar, metadata{});
62}
63
64template <typename Tp>
65void
66serialization<Tp, true>::operator()(cereal::MinimalJSONOutputArchive& ar,
67 const basic_tree_vector_type& data, ...) const
68{
69 impl(ar, data);
70}
71
72template <typename Tp>
73void
74serialization<Tp, true>::operator()(cereal::MinimalJSONOutputArchive& ar,
75 const std::vector<basic_tree_vector_type>& data,
76 ...) const
77{
78 impl(ar, data);
79}
80
81template <typename Tp>
82void
83serialization<Tp, true>::operator()(cereal::MinimalJSONOutputArchive& ar,
84 const basic_tree_map_type& data, ...) const
85{
86 impl(ar, data);
87}
88
89template <typename Tp>
90void
91serialization<Tp, true>::operator()(cereal::MinimalJSONOutputArchive& ar,
92 const result_type& data, ...) const
93{
94 impl(ar, data);
95}
96
97template <typename Tp>
98void
99serialization<Tp, true>::operator()(cereal::MinimalJSONOutputArchive& ar,
100 const distrib_type& data, ...) const
101{
102 impl(ar, data);
103}
104
105template <typename Tp>
106serialization<Tp, true>::serialization(const Tp& obj, cereal::PrettyJSONOutputArchive& ar,
107 const unsigned int version, ...)
108{
109 impl(obj, ar, version);
110}
111
112template <typename Tp>
113void
114serialization<Tp, true>::operator()(const Tp& obj, cereal::PrettyJSONOutputArchive& ar,
115 const unsigned int version, ...) const
116{
117 impl(obj, ar, version);
118}
119
120template <typename Tp>
121void
122serialization<Tp, true>::operator()(cereal::PrettyJSONOutputArchive& ar, metadata,
123 ...) const
124{
125 impl(ar, metadata{});
126}
127
128template <typename Tp>
129void
130serialization<Tp, true>::operator()(cereal::PrettyJSONOutputArchive& ar,
131 const basic_tree_vector_type& data, ...) const
132{
133 impl(ar, data);
134}
135
136template <typename Tp>
137void
138serialization<Tp, true>::operator()(cereal::PrettyJSONOutputArchive& ar,
139 const std::vector<basic_tree_vector_type>& data,
140 ...) const
141{
142 impl(ar, data);
143}
144
145template <typename Tp>
146void
147serialization<Tp, true>::operator()(cereal::PrettyJSONOutputArchive& ar,
148 const basic_tree_map_type& data, ...) const
149{
150 impl(ar, data);
151}
152
153template <typename Tp>
154void
155serialization<Tp, true>::operator()(cereal::PrettyJSONOutputArchive& ar,
156 const result_type& data, ...) const
157{
158 impl(ar, data);
159}
160
161template <typename Tp>
162void
163serialization<Tp, true>::operator()(cereal::PrettyJSONOutputArchive& ar,
164 const distrib_type& data, ...) const
165{
166 impl(ar, data);
167}
168
169template <typename Tp>
170void
171serialization<Tp, true>::operator()(cereal::JSONInputArchive& ar,
172 basic_tree_vector_type& data, ...) const
173{
174 impl(ar, data);
175}
176
177template <typename Tp>
178void
179serialization<Tp, true>::operator()(cereal::JSONInputArchive& ar,
180 std::vector<basic_tree_vector_type>& data, ...) const
181{
182 impl(ar, data);
183}
184
185template <typename Tp>
186void
187serialization<Tp, true>::operator()(cereal::JSONInputArchive& ar, result_type& data,
188 ...) const
189{
190 impl(ar, data);
191}
192
193template <typename Tp>
194void
195serialization<Tp, true>::operator()(cereal::JSONInputArchive& ar, distrib_type& data,
196 ...) const
197{
198 impl(ar, data);
199}
200//
201} // namespace internal
202} // namespace operation
203} // namespace tim
204
205#endif
Definition: kokkosp.cpp:39