1#ifndef HALIDE_ABSTRACT_GENERATOR_H_
2#define HALIDE_ABSTRACT_GENERATOR_H_
78 virtual std::string
name() = 0;
160 virtual void bind_input(
const std::string &
name,
const std::vector<Parameter> &v) = 0;
161 virtual void bind_input(
const std::string &
name,
const std::vector<Func> &v) = 0;
162 virtual void bind_input(
const std::string &
name,
const std::vector<Expr> &v) = 0;
193 virtual bool emit_hlpipe(
const std::string &hlpipe_file_path) = 0;
236 const std::map<std::string, JITExtern> *jit_externs =
nullptr);
Defines the front-end class representing a jitted, callable Halide pipeline.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines Func - the front-end handle on a halide function, and related classes.
Defines Module, an IR container that fully describes a Halide program.
Defines the internal representation of parameters to halide piplines.
Defines the front-end class representing an entire Halide imaging pipeline.
Defines the internal representation of the schedule for a function.
Defines the structure that describes a Halide target.
A Halide::Buffer is a named shared reference to a Halide::Runtime::Buffer.
GeneratorContext is a class that is used when using Generators (or Stubs) directly; it is used to all...
AbstractGenerator is an ABC that defines the API a Generator must provide to work with the existing G...
virtual std::vector< ArgInfo > arginfos()=0
Return a list of all the ArgInfos for this generator.
virtual bool emit_cpp_stub(const std::string &stub_file_path)=0
Emit a Generator Stub (.stub.h) file to the given path.
void set_generatorparam_values(const GeneratorParamsMap &m)
virtual void set_generatorparam_value(const std::string &name, const std::string &value)=0
Set the value for a specific GeneratorParam for an AbstractGenerator instance.
virtual bool emit_hlpipe(const std::string &hlpipe_file_path)=0
Emit a Serialized Halide Pipeline (.hlpipe) file to the given path.
virtual void bind_input(const std::string &name, const std::vector< Func > &v)=0
virtual bool allow_out_of_order_inputs_and_outputs() const =0
By default, a Generator must declare all Inputs before all Outputs.
virtual void bind_input(const std::string &name, const std::vector< Parameter > &v)=0
Rebind a specified Input to refer to the given piece of IR, replacing the default ImageParam / Param ...
Callable compile_to_callable(const JITHandlers *jit_handlers=nullptr, const std::map< std::string, JITExtern > *jit_externs=nullptr)
JIT the AbstractGenerator into a Callable (using the currently-set Target) and return it.
virtual std::vector< Func > output_func(const std::string &name)=0
Given the name of an output, return the Func(s) for that output.
virtual ~AbstractGenerator()=default
virtual void set_generatorparam_value(const std::string &name, const LoopLevel &loop_level)=0
virtual void bind_input(const std::string &name, const std::vector< Expr > &v)=0
virtual Pipeline build_pipeline()=0
Build and return the Pipeline for this AbstractGenerator.
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.
virtual std::string name()=0
Return the name of this Generator.
virtual GeneratorContext context() const =0
Return the Target and autoscheduler info that this Generator was created with.
Module build_module(const std::string &function_name="")
Call generate() and produce a Module for the result.
virtual std::vector< Parameter > input_parameter(const std::string &name)=0
Given the name of an input, return the Parameter(s) for that input.
A reference to a site in a Halide statement at the top of the body of a particular for loop.
A class representing a Halide pipeline.
std::unique_ptr< AbstractGenerator > AbstractGeneratorPtr
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
std::map< std::string, std::string > GeneratorParamsMap
ArgInfo is a struct to contain name-and-type information for the inputs and outputs to the Pipeline t...
std::vector< Type > types
A set of custom overrides of runtime functions.