1 #ifndef HALIDE_PARAMETER_H
2 #define HALIDE_PARAMETER_H
16 struct ArgumentEstimates;
25 struct ParameterContents;
30 void check_defined()
const;
31 void check_is_buffer()
const;
32 void check_is_scalar()
const;
33 void check_dim_ok(
int dim)
const;
34 void check_type(
const Type &t)
const;
71 const std::string &
name()
const;
80 check_type(type_of<T>());
92 check_type(type_of<T>());
This file declares the routines used by Halide internally in its runtime.
Support classes for reference-counting via intrusive shared pointers.
Various utility functions used internally Halide.
#define HALIDE_NO_USER_CODE_INLINE
A reference-counted handle to a parameter to a halide pipeline.
Expr default_value() const
ArgumentEstimates get_argument_estimates() const
Get the ArgumentEstimates appropriate for this Parameter.
Expr stride_constraint(int dim) const
Expr extent_constraint(int dim) const
void set_estimate(Expr e)
Parameter(const Type &t, bool is_buffer, int dimensions)
Construct a new parameter of the given type.
int host_alignment() const
HALIDE_NO_USER_CODE_INLINE void set_scalar(const Type &val_type, halide_scalar_value_t val)
If the parameter is a scalar parameter, set its current value.
MemoryType memory_type() const
HALIDE_NO_USER_CODE_INLINE T scalar() const
If the parameter is a scalar parameter, get its currently bound value.
void set_buffer(const Buffer< void > &b)
If the parameter is a buffer parameter, set its current value.
HALIDE_NO_USER_CODE_INLINE void set_scalar(T val)
If the parameter is a scalar parameter, set its current value.
void set_default_value(const Expr &e)
Get and set the default values for scalar parameters.
const std::string & name() const
Get the name of this parameter.
Type type() const
Get the type of this parameter.
bool is_buffer() const
Does this parameter refer to a buffer/image?
void set_min_value(const Expr &e)
Get and set constraints for scalar parameters.
Parameter(Parameter &&)=default
Expr min_constraint(int dim) const
void store_in(MemoryType memory_type)
Expr scalar_expr() const
This returns the current value of scalar<type()>() as an Expr.
Expr extent_constraint_estimate(int dim) const
const halide_buffer_t * raw_buffer() const
Get the raw currently-bound buffer.
Parameter(const Parameter &)=default
void set_host_alignment(int bytes)
void set_extent_constraint_estimate(int dim, Expr extent)
IntrusivePtr< ParameterContents > contents
void set_extent_constraint(int dim, Expr e)
Parameter & operator=(Parameter &&)=default
void set_min_constraint(int dim, Expr e)
Get and set constraints for the min, extent, stride, and estimates on the min/extent.
void * scalar_address() const
Get the pointer to the current value of the scalar parameter.
void set_min_constraint_estimate(int dim, Expr min)
int dimensions() const
Get the dimensionality of this parameter.
Parameter & operator=(const Parameter &)=default
void set_stride_constraint(int dim, Expr e)
void set_max_value(const Expr &e)
bool defined() const
Tests if this handle is non-nullptr.
bool operator<(const Parameter &other) const
Order Parameters by their IntrusivePtr so they can be used to index maps.
bool same_as(const Parameter &other) const
Tests if this handle is the same as another handle.
Parameter(const Type &t, bool is_buffer, int dimensions, const std::string &name)
Construct a new parameter of the given type with name given by the third argument.
Parameter()=default
Construct a new undefined handle.
Buffer< void > buffer() const
If the parameter is a buffer parameter, get its currently bound buffer.
Expr min_constraint_estimate(int dim) const
void check_call_arg_types(const std::string &name, std::vector< Expr > *args, int dims)
Validate arguments to a call to a func, image or imageparam.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
Expr min(const FuncRef &a, const FuncRef &b)
Explicit overloads of min and max for FuncRef.
MemoryType
An enum describing different address spaces to be used with Func::store_in.
void * memcpy(void *s1, const void *s2, size_t n)
A fragment of Halide syntax.
Types in the halide type system.
int bytes() const
The number of bytes required to store a single scalar value of this type.
The raw representation of an image passed around by generated Halide code.
halide_scalar_value_t is a simple union able to represent all the well-known scalar values in a filte...