1 #ifndef HALIDE_PARAM_MAP_H
2 #define HALIDE_PARAM_MAP_H
57 ParamArg(
const ParamMapping &pm)
58 : mapped_param(pm.parameter->type(), false, 0, pm.parameter->name()) {
59 mapped_param.
set_scalar(pm.parameter->type(), pm.value);
61 ParamArg(Buffer<> *buf_ptr)
62 : buf_out_param(buf_ptr) {
64 ParamArg(
const ParamArg &) =
default;
66 mutable std::map<const Internal::Parameter, ParamArg> mapping;
68 void set(
const ImageParam &p,
const Buffer<> &
buf, Buffer<> *buf_out_param);
73 ParamMap(
const std::initializer_list<ParamMapping> &init);
81 pa.buf_out_param =
nullptr;
90 return mapping.size();
106 return empty_param_map;
Classes for declaring scalar parameters to halide pipelines.
Defines the internal representation of parameters to halide piplines.
A Halide::Buffer is a named shared reference to a Halide::Runtime::Buffer.
An Image parameter to a halide pipeline.
A reference-counted handle to a parameter to a halide pipeline.
HALIDE_NO_USER_CODE_INLINE void set_scalar(T val)
If the parameter is a scalar parameter, set its current value.
A scalar parameter to a halide pipeline.
const std::string & name() const
Get the name of this parameter.
const Internal::Parameter & parameter() const
Type type() const
Get the halide type of the Param.
const Internal::Parameter & map(const Internal::Parameter &p, Buffer<> *&buf_out_param) const
If there is an entry in the ParamMap for this Parameter, return it.
void set(const Param< T > &p, T val)
static const ParamMap & empty_map()
A const ref to an empty ParamMap.
Internal::Parameter & map(Internal::Parameter &p, Buffer<> *&buf_out_param) const
void set(const ImageParam &p, const Buffer<> &buf)
ParamMap(const std::initializer_list< ParamMapping > &init)
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
const ImageParam * image_param
ParamMapping(const ImageParam &p, Buffer<> *buf_ptr)
ParamMapping(const ImageParam &p, Buffer<> &buf)
const Internal::Parameter * parameter
ParamMapping(const Param< T > &p, const T &val)
ParamMapping(const ImageParam &p, Buffer< T > &buf)
halide_scalar_value_t value
ParamMapping(const ImageParam &p, Buffer< T > *buf_ptr)
halide_scalar_value_t is a simple union able to represent all the well-known scalar values in a filte...