Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Deserialization.h
Go to the documentation of this file.
1#ifndef HALIDE_DESERIALIZATION_H
2#define HALIDE_DESERIALIZATION_H
3
4#include "Pipeline.h"
5#include <istream>
6#include <string>
7
8namespace Halide {
9
10/// @brief Deserialize a Halide pipeline from a file.
11/// @param filename The location of the file to deserialize. Must use .hlpipe extension.
12/// @param user_params Map of named input/output parameters to bind with the resulting pipeline (used to avoid deserializing specific objects and enable the use of externally defined ones instead).
13/// @return Returns a newly constructed deserialized Pipeline object/
14Pipeline deserialize_pipeline(const std::string &filename, const std::map<std::string, Parameter> &user_params);
15
16/// @brief Deserialize a Halide pipeline from an input stream.
17/// @param in The input stream to read from containing a serialized Halide pipeline
18/// @param user_params Map of named input/output parameters to bind with the resulting pipeline (used to avoid deserializing specific objects and enable the use of externally defined ones instead).
19/// @return Returns a newly constructed deserialized Pipeline object/
20Pipeline deserialize_pipeline(std::istream &in, const std::map<std::string, Parameter> &user_params);
21
22/// @brief Deserialize a Halide pipeline from a byte buffer containing a serizalized pipeline in binary format
23/// @param data The data buffer containing a serialized Halide pipeline
24/// @param user_params Map of named input/output parameters to bind with the resulting pipeline (used to avoid deserializing specific objects and enable the use of externally defined ones instead).
25/// @return Returns a newly constructed deserialized Pipeline object/
26Pipeline deserialize_pipeline(const std::vector<uint8_t> &data, const std::map<std::string, Parameter> &user_params);
27
28/// @brief Deserialize the extenal parameters for the Halide pipeline from a file.
29/// This method allows a minimal deserialization of just the external pipeline parameters, so they can be
30/// remapped and overridden with user parameters prior to deserializing the pipeline definition.
31/// @param filename The location of the file to deserialize. Must use .hlpipe extension.
32/// @return Returns a map containing the names and description of external parameters referenced in the pipeline
33std::map<std::string, Parameter> deserialize_parameters(const std::string &filename);
34
35/// @brief Deserialize the extenal parameters for the Halide pipeline from input stream.
36/// This method allows a minimal deserialization of just the external pipeline parameters, so they can be
37/// remapped and overridden with user parameters prior to deserializing the pipeline definition.
38/// @param in The input stream to read from containing a serialized Halide pipeline
39/// @return Returns a map containing the names and description of external parameters referenced in the pipeline
40std::map<std::string, Parameter> deserialize_parameters(std::istream &in);
41
42/// @brief Deserialize the extenal parameters for the Halide pipeline from a byte buffer containing a serialized
43/// pipeline in binary format. This method allows a minimal deserialization of just the external pipeline
44/// parameters, so they can be remapped and overridden with user parameters prior to deserializing the
45/// pipeline definition.
46/// @param data The data buffer containing a serialized Halide pipeline
47/// @return Returns a map containing the names and description of external parameters referenced in the pipeline
48std::map<std::string, Parameter> deserialize_parameters(const std::vector<uint8_t> &data);
49
50} // namespace Halide
51
52#endif
Defines the front-end class representing an entire Halide imaging pipeline.
A class representing a Halide pipeline.
Definition Pipeline.h:107
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
std::map< std::string, Parameter > deserialize_parameters(const std::string &filename)
Deserialize the extenal parameters for the Halide pipeline from a file.
Pipeline deserialize_pipeline(const std::string &filename, const std::map< std::string, Parameter > &user_params)
Deserialize a Halide pipeline from a file.