Halide 19.0.0
Halide compiler and libraries
|
A scalar parameter to a halide pipeline. More...
#include <Param.h>
Public Member Functions | |
Param () | |
Construct a scalar parameter of type T with a unique auto-generated name. | |
Param (Type t) | |
Param (const std::string &n) | |
Construct a scalar parameter of type T with the given name. | |
Param (const char *n) | |
Param (Type t, const std::string &n) | |
template<typename T2 = T, typename std::enable_if<!std::is_pointer< T2 >::value >::type * = nullptr> | |
Param (not_void_T val) | |
Construct a scalar parameter of type T an initial value of 'val'. | |
Param (const std::string &n, not_void_T val) | |
Construct a scalar parameter of type T with the given name and an initial value of 'val'. | |
Param (not_void_T val, const Expr &min, const Expr &max) | |
Construct a scalar parameter of type T with an initial value of 'val' and a given min and max. | |
Param (const std::string &n, not_void_T val, const Expr &min, const Expr &max) | |
Construct a scalar parameter of type T with the given name and an initial value of 'val' and a given min and max. | |
template<typename OTHER_TYPE , typename T2 = T, typename std::enable_if< std::is_void< T2 >::value >::type * = nullptr> | |
Param (const Param< OTHER_TYPE > &other) | |
Construct a Param<void> from any other Param. | |
template<typename OTHER_TYPE , typename T2 = T, typename std::enable_if<!std::is_void< T2 >::value >::type * = nullptr> | |
Param (const Param< OTHER_TYPE > &other) | |
Construct a Param<non-void> from a Param with matching type. | |
template<typename OTHER_TYPE , typename T2 = T, typename std::enable_if< std::is_void< T2 >::value >::type * = nullptr> | |
Param< T > & | operator= (const Param< OTHER_TYPE > &other) |
Copy a Param<void> from any other Param. | |
template<typename OTHER_TYPE , typename T2 = T, typename std::enable_if<!std::is_void< T2 >::value >::type * = nullptr> | |
Param< T > & | operator= (const Param< OTHER_TYPE > &other) |
Copy a Param<non-void> from a Param with matching type. | |
const std::string & | name () const |
Get the name of this parameter. | |
template<typename T2 = not_void_T> | |
HALIDE_NO_USER_CODE_INLINE T2 | get () const |
Get the current value of this parameter. | |
template<typename SOME_TYPE > | |
HALIDE_NO_USER_CODE_INLINE void | set (const SOME_TYPE &val) |
Set the current value of this parameter. | |
Type | type () const |
Get the halide type of the Param. | |
void | set_range (const Expr &min, const Expr &max) |
Get or set the possible range of this parameter. | |
void | set_min_value (Expr min) |
void | set_max_value (Expr max) |
Expr | min_value () const |
Expr | max_value () const |
template<typename SOME_TYPE > | |
HALIDE_NO_USER_CODE_INLINE void | set_estimate (const SOME_TYPE &val) |
operator Expr () const | |
You can use this parameter as an expression in a halide function definition. | |
operator ExternFuncArgument () const | |
Using a param as the argument to an external stage treats it as an Expr. | |
operator Argument () const | |
Construct the appropriate argument matching this parameter, for the purpose of generating the right type signature when statically compiling halide pipelines. | |
const Parameter & | parameter () const |
Parameter & | parameter () |
Static Public Member Functions | |
static Type | static_type () |
Get the Halide type of T. | |
Static Public Attributes | |
static constexpr bool | has_static_type = !std::is_void<T>::value |
True if the Halide type is not void (or const void). | |
A scalar parameter to a halide pipeline.
If you're jitting, this should be bound to an actual value of type T using the set method before you realize the function uses this. If you're statically compiling, this param should appear in the argument list.
|
inline |
Construct a scalar parameter of type T with a unique auto-generated name.
Definition at line 60 of file Param.h.
References Halide::Param< T >::has_static_type, and Halide::Internal.
|
inlineexplicit |
Definition at line 64 of file Param.h.
References Halide::Param< T >::has_static_type, and Halide::Internal.
|
inlineexplicit |
Construct a scalar parameter of type T with the given name.
Definition at line 72 of file Param.h.
References Halide::Param< T >::has_static_type.
|
inlineexplicit |
Definition at line 77 of file Param.h.
References Halide::Param< T >::has_static_type.
|
inline |
Definition at line 82 of file Param.h.
References Halide::Param< T >::has_static_type.
|
inlineexplicit |
Construct a scalar parameter of type T an initial value of 'val'.
Only triggers for non-pointer types.
Definition at line 92 of file Param.h.
References Halide::Param< T >::has_static_type, Halide::Internal, and Halide::Param< T >::set().
|
inline |
Construct a scalar parameter of type T with the given name and an initial value of 'val'.
Definition at line 100 of file Param.h.
References Halide::Param< T >::has_static_type, and Halide::Param< T >::set().
|
inline |
Construct a scalar parameter of type T with an initial value of 'val' and a given min and max.
Definition at line 109 of file Param.h.
References Halide::Param< T >::has_static_type, Halide::Internal, Halide::Param< T >::set(), and Halide::Param< T >::set_range().
|
inline |
Construct a scalar parameter of type T with the given name and an initial value of 'val' and a given min and max.
Definition at line 118 of file Param.h.
References Halide::Param< T >::has_static_type, Halide::Param< T >::set(), and Halide::Param< T >::set_range().
|
inline |
|
inline |
Construct a Param<non-void> from a Param with matching type.
(Do the check at runtime so that we can assign from Param<void> if the types are compatible.)
Definition at line 136 of file Param.h.
References Halide::Param< T >::type(), Halide::type_of(), and user_assert.
|
inlinestatic |
Get the Halide type of T.
Callers should not use the result if has_static_halide_type is false.
Definition at line 52 of file Param.h.
References Halide::Param< T >::has_static_type, internal_assert, and Halide::type_of().
|
inline |
|
inline |
Copy a Param<non-void> from a Param with matching type.
(Do the check at runtime so that we can assign from Param<void> if the types are compatible.)
Definition at line 152 of file Param.h.
References Halide::Param< T >::type(), Halide::type_of(), and user_assert.
|
inline |
Get the name of this parameter.
Definition at line 160 of file Param.h.
References Halide::Parameter::name().
Referenced by Halide::Param< T >::operator Argument(), and Halide::Param< T >::operator Expr().
|
inline |
Get the current value of this parameter.
Only meaningful when jitting. Asserts if type does not exactly match the Parameter's type.
Definition at line 167 of file Param.h.
References Halide::Parameter::scalar().
|
inline |
Set the current value of this parameter.
Only meaningful when jitting. Asserts if type is not losslessly-convertible to Parameter's type.
Definition at line 174 of file Param.h.
References HALIDE_HANDLE_TYPE_DISPATCH, halide_type_float, halide_type_handle, halide_type_int, halide_type_uint, internal_error, Halide::Parameter::set_scalar(), Halide::Param< T >::type(), Halide::Parameter::type(), and user_assert.
Referenced by Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), and Halide::Param< T >::Param().
|
inline |
Get the halide type of the Param.
Definition at line 218 of file Param.h.
References Halide::Parameter::type().
Referenced by Halide::Param< T >::operator Argument(), Halide::Param< T >::operator=(), Halide::Param< T >::Param(), Halide::Param< T >::set(), and Halide::Param< T >::set_estimate().
|
inline |
Get or set the possible range of this parameter.
Use undefined Exprs to mean unbounded.
Definition at line 225 of file Param.h.
References Halide::Param< T >::set_max_value(), and Halide::Param< T >::set_min_value().
Referenced by Halide::Param< T >::Param(), and Halide::Param< T >::Param().
|
inline |
Definition at line 230 of file Param.h.
References Halide::Internal::Cast::make(), Halide::Parameter::set_min_value(), and Halide::Parameter::type().
Referenced by Halide::Param< T >::set_range().
|
inline |
Definition at line 237 of file Param.h.
References Halide::Internal::Cast::make(), Halide::Parameter::set_max_value(), and Halide::Parameter::type().
Referenced by Halide::Param< T >::set_range().
|
inline |
Definition at line 244 of file Param.h.
References Halide::Parameter::min_value().
|
inline |
Definition at line 248 of file Param.h.
References Halide::Parameter::max_value().
|
inline |
Definition at line 254 of file Param.h.
References HALIDE_HANDLE_TYPE_DISPATCH, halide_type_float, halide_type_handle, halide_type_int, halide_type_uint, internal_error, Halide::Parameter::set_estimate(), Halide::Param< T >::type(), Halide::Parameter::type(), and user_assert.
|
inline |
You can use this parameter as an expression in a halide function definition.
Definition at line 299 of file Param.h.
References Halide::Internal::Variable::make(), Halide::Param< T >::name(), and Halide::Parameter::type().
|
inline |
|
inline |
Construct the appropriate argument matching this parameter, for the purpose of generating the right type signature when statically compiling halide pipelines.
Definition at line 312 of file Param.h.
References Halide::Parameter::get_argument_estimates(), Halide::Argument::InputScalar, Halide::Param< T >::name(), and Halide::Param< T >::type().
|
inline |
|
inline |
|
staticconstexpr |
True if the Halide type is not void (or const void).
Definition at line 48 of file Param.h.
Referenced by Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), Halide::Param< T >::Param(), and Halide::Param< T >::static_type().