1/**
2 * Copyright (c) Glow Contributors. See CONTRIBUTORS file.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef GLOW_QUANTIZATION_SERIALIZATION_H
18#define GLOW_QUANTIZATION_SERIALIZATION_H
19
20#include "glow/Quantization/Base/Base.h"
21
22#include "llvm/ADT/APInt.h"
23
24namespace glow {
25
26/// Serialize into the file named \p fileName the hash \p graphPreLowerHash
27/// of the graph pre lowering and the profiling information \p profilingInfos.
28void serializeProfilingInfosToYaml(
29 llvm::StringRef fileName, llvm::hash_code graphPreLowerHash,
30 std::vector<NodeProfilingInfo> &profilingInfos);
31
32/// Deserialize from the file named \p fileName the hash \p graphPreLowerHash
33/// of the graph pre lowering and the profiling information \p profilingInfos.
34bool deserializeProfilingInfosFromYaml(
35 llvm::StringRef fileName, llvm::hash_code &graphPreLowerHash,
36 std::vector<NodeProfilingInfo> &profilingInfos);
37
38} // namespace glow
39
40#endif
41