Halide 22.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
8 namespace 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/
14 Pipeline 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/
20 Pipeline 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 serialized 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/
26 Pipeline deserialize_pipeline(const std::vector<uint8_t> &data, const std::map<std::string, Parameter> &user_params);
27
28/// @brief Deserialize the external 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
33 std::map<std::string, Parameter> deserialize_parameters(const std::string &filename);
34
35/// @brief Deserialize the external 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
40 std::map<std::string, Parameter> deserialize_parameters(std::istream &in);
41
42/// @brief Deserialize the external 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
48 std::map<std::string, Parameter> deserialize_parameters(const std::vector<uint8_t> &data);
49
50} // namespace Halide
51
52#endif
Pipeline.h
Defines the front-end class representing an entire Halide imaging pipeline.
Halide::Pipeline
A class representing a Halide pipeline.
Definition Pipeline.h:107
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::deserialize_parameters
std::map< std::string, Parameter > deserialize_parameters(const std::string &filename)
Deserialize the external parameters for the Halide pipeline from a file.
Halide::cast
Internal::ConstantInterval cast(Type t, const Internal::ConstantInterval &a)
Cast operators for ConstantIntervals.
Halide::deserialize_pipeline
Pipeline deserialize_pipeline(const std::string &filename, const std::map< std::string, Parameter > &user_params)
Deserialize a Halide pipeline from a file.