|
Halide
13.0.4
Halide compiler and libraries
|
#include <Generator.h>
Inherits Halide::NamesInterface, and Halide::GeneratorContext.
Inherited by Halide::Generator< T >.
Public Member Functions | |
| ~GeneratorBase () override | |
| void | set_generator_param_values (const GeneratorParamsMap ¶ms) |
| int | natural_vector_size (Halide::Type t) const |
| Given a data type, return an estimate of the "natural" vector size for that data type when compiling for the current target. More... | |
| template<typename data_t > | |
| int | natural_vector_size () const |
| Given a data type, return an estimate of the "natural" vector size for that data type when compiling for the current target. More... | |
| void | emit_cpp_stub (const std::string &stub_file_path) |
| Module | build_module (const std::string &function_name="", LinkageType linkage_type=LinkageType::ExternalPlusMetadata) |
| Module | build_gradient_module (const std::string &function_name) |
| Build a module that is suitable for using for gradient descent calculation in TensorFlow or PyTorch. More... | |
| template<typename... Args> | |
| void | set_inputs (const Args &...args) |
| set_inputs is a variadic wrapper around set_inputs_vector, which makes usage much simpler in many cases, as it constructs the relevant entries for the vector for you, which is often a bit unintuitive at present. More... | |
| Realization | realize (std::vector< int32_t > sizes) |
| template<typename... Args, typename std::enable_if< NoRealizations< Args... >::value >::type * = nullptr> | |
| Realization | realize (Args &&...args) |
| void | realize (Realization r) |
| Pipeline | get_pipeline () |
| template<typename T , typename std::enable_if<!std::is_arithmetic< T >::value >::type * = nullptr> | |
| GeneratorInput< T > * | add_input (const std::string &name, const Type &t, int dimensions) |
| template<typename T , typename std::enable_if< T::has_static_halide_type >::type * = nullptr> | |
| GeneratorInput< T > * | add_input (const std::string &name, int dimensions) |
| template<typename T , typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr> | |
| GeneratorInput< T > * | add_input (const std::string &name) |
| template<typename T , typename std::enable_if< std::is_same< T, Expr >::value >::type * = nullptr> | |
| GeneratorInput< T > * | add_input (const std::string &name, const Type &type) |
| template<typename T , typename std::enable_if<!std::is_arithmetic< T >::value >::type * = nullptr> | |
| GeneratorOutput< T > * | add_output (const std::string &name, const Type &t, int dimensions) |
| template<typename T , typename std::enable_if< T::has_static_halide_type >::type * = nullptr> | |
| GeneratorOutput< T > * | add_output (const std::string &name, int dimensions) |
| template<typename... Args> | |
| HALIDE_NO_USER_CODE_INLINE void | add_requirement (Expr condition, Args &&...args) |
| void | trace_pipeline () |
| GeneratorBase (const GeneratorBase &)=delete | |
| GeneratorBase & | operator= (const GeneratorBase &)=delete |
| GeneratorBase (GeneratorBase &&that)=delete | |
| GeneratorBase & | operator= (GeneratorBase &&that)=delete |
Public Member Functions inherited from Halide::GeneratorContext | |
| GeneratorContext (const Target &t, bool auto_schedule=false, const MachineParams &machine_params=MachineParams::generic()) | |
| virtual | ~GeneratorContext ()=default |
| Target | get_target () const |
| bool | get_auto_schedule () const |
| MachineParams | get_machine_params () const |
| std::shared_ptr< ExternsMap > | get_externs_map () const |
| Generators can register ExternalCode objects onto themselves. More... | |
| template<typename T > | |
| std::unique_ptr< T > | create () const |
| template<typename T , typename... Args> | |
| std::unique_ptr< T > | apply (const Args &...args) const |
| GeneratorContext (const GeneratorContext &)=delete | |
| GeneratorContext & | operator= (const GeneratorContext &)=delete |
| GeneratorContext (GeneratorContext &&)=delete | |
| GeneratorContext & | operator= (GeneratorContext &&)=delete |
Protected Member Functions | |
| GeneratorBase (size_t size, const void *introspection_helper) | |
| void | set_generator_names (const std::string ®istered_name, const std::string &stub_name) |
| void | init_from_context (const Halide::GeneratorContext &context) override |
| virtual Pipeline | build_pipeline ()=0 |
| virtual void | call_configure ()=0 |
| virtual void | call_generate ()=0 |
| virtual void | call_schedule ()=0 |
| void | track_parameter_values (bool include_outputs) |
| void | pre_build () |
| void | post_build () |
| void | pre_configure () |
| void | post_configure () |
| void | pre_generate () |
| void | post_generate () |
| void | pre_schedule () |
| void | post_schedule () |
| void | check_exact_phase (Phase expected_phase) const |
| void | check_min_phase (Phase expected_phase) const |
| void | advance_phase (Phase new_phase) |
| void | ensure_configure_has_been_called () |
Protected Member Functions inherited from Halide::GeneratorContext | |
| GeneratorContext () | |
| std::shared_ptr< Internal::ValueTracker > | get_value_tracker () const |
Protected Attributes | |
| enum Halide::Internal::GeneratorBase::Phase | Created |
Protected Attributes inherited from Halide::GeneratorContext | |
| GeneratorParam< Target > | target |
| GeneratorParam< bool > | auto_schedule |
| GeneratorParam< MachineParams > | machine_params |
| std::shared_ptr< ExternsMap > | externs_map |
| std::shared_ptr< Internal::ValueTracker > | value_tracker |
Additional Inherited Members | |
Public Types inherited from Halide::GeneratorContext | |
| using | ExternsMap = std::map< std::string, ExternalCode > |
Static Protected Member Functions inherited from Halide::NamesInterface | |
| template<typename T > | |
| static Expr | cast (Expr e) |
| static Expr | cast (Halide::Type t, Expr e) |
| static Type | Bool (int lanes=1) |
| static Type | Float (int bits, int lanes=1) |
| static Type | Int (int bits, int lanes=1) |
| static Type | UInt (int bits, int lanes=1) |
Definition at line 3078 of file Generator.h.
|
protected |
Definition at line 3270 of file Generator.h.
|
protected |
Definition at line 3273 of file Generator.h.
|
protected |
| Enumerator | |
|---|---|
| Created | |
| ConfigureCalled | |
| InputsSet | |
| GenerateCalled | |
| ScheduleCalled | |
Definition at line 3278 of file Generator.h.
|
override |
|
protected |
|
delete |
|
delete |
| void Halide::Internal::GeneratorBase::set_generator_param_values | ( | const GeneratorParamsMap & | params | ) |
|
inline |
Given a data type, return an estimate of the "natural" vector size for that data type when compiling for the current target.
Definition at line 3086 of file Generator.h.
References Halide::GeneratorContext::get_target(), and Halide::Target::natural_vector_size().
|
inline |
Given a data type, return an estimate of the "natural" vector size for that data type when compiling for the current target.
Definition at line 3093 of file Generator.h.
References Halide::GeneratorContext::get_target(), and Halide::Target::natural_vector_size().
| void Halide::Internal::GeneratorBase::emit_cpp_stub | ( | const std::string & | stub_file_path | ) |
| Module Halide::Internal::GeneratorBase::build_module | ( | const std::string & | function_name = "", |
| LinkageType | linkage_type = LinkageType::ExternalPlusMetadata |
||
| ) |
| Module Halide::Internal::GeneratorBase::build_gradient_module | ( | const std::string & | function_name | ) |
Build a module that is suitable for using for gradient descent calculation in TensorFlow or PyTorch.
Essentially:
The new Pipeline is adjoint to the original; it has:
|
inline |
set_inputs is a variadic wrapper around set_inputs_vector, which makes usage much simpler in many cases, as it constructs the relevant entries for the vector for you, which is often a bit unintuitive at present.
The arguments are passed in Input<>-declaration-order, and the types must be compatible. Array inputs are passed as std::vector<> of the relevant type.
Note: at present, scalar input types must match exactly, i.e., for Input<uint8_t>, you must pass an argument that is actually uint8_t; an argument that is int-that-will-fit-in-uint8 will assert-fail at Halide compile time.
Definition at line 3131 of file Generator.h.
References Halide::Internal::GeneratorParamInfo::inputs(), and user_assert.
Referenced by Halide::Generator< T >::apply().
|
inline |
Definition at line 3140 of file Generator.h.
References get_pipeline(), Halide::GeneratorContext::get_target(), and Halide::Pipeline::realize().
|
inline |
Definition at line 3148 of file Generator.h.
References get_pipeline(), Halide::GeneratorContext::get_target(), and Halide::Pipeline::realize().
|
inline |
Definition at line 3153 of file Generator.h.
References get_pipeline(), Halide::GeneratorContext::get_target(), and Halide::Pipeline::realize().
| Pipeline Halide::Internal::GeneratorBase::get_pipeline | ( | ) |
Referenced by add_requirement(), realize(), and trace_pipeline().
|
inline |
Definition at line 3168 of file Generator.h.
References check_exact_phase(), and ConfigureCalled.
|
inline |
Definition at line 3180 of file Generator.h.
References check_exact_phase(), and ConfigureCalled.
|
inline |
Definition at line 3192 of file Generator.h.
References check_exact_phase(), and ConfigureCalled.
|
inline |
Definition at line 3204 of file Generator.h.
References check_exact_phase(), and ConfigureCalled.
|
inline |
Definition at line 3217 of file Generator.h.
References check_exact_phase(), and ConfigureCalled.
|
inline |
Definition at line 3229 of file Generator.h.
References check_exact_phase(), and ConfigureCalled.
|
inline |
Definition at line 3239 of file Generator.h.
References Halide::Pipeline::add_requirement(), and get_pipeline().
|
inline |
Definition at line 3243 of file Generator.h.
References get_pipeline(), and Halide::Pipeline::trace_pipeline().
|
protected |
|
overrideprotectedvirtual |
Reimplemented from Halide::GeneratorContext.
|
protectedpure virtual |
Implemented in Halide::Generator< T >.
|
protectedpure virtual |
Implemented in Halide::Generator< T >.
|
protectedpure virtual |
Implemented in Halide::Generator< T >.
|
protectedpure virtual |
Implemented in Halide::Generator< T >.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by add_input(), and add_output().
|
protected |
|
protected |
|
protected |
|
delete |
|
delete |
|
protected |