Go to the documentation of this file. 1 #ifndef HALIDE_ABSTRACT_GENERATOR_H_
2 #define HALIDE_ABSTRACT_GENERATOR_H_
78 virtual std::string
name() = 0;
101 virtual std::vector<ArgInfo>
arginfos() = 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;
178 virtual bool emit_cpp_stub(
const std::string &stub_file_path) = 0;
213 const std::map<std::string, JITExtern> *jit_externs =
nullptr);
virtual ~AbstractGenerator()=default
virtual GeneratorContext context() const =0
Return the Target and autoscheduler info that this Generator was created with.
AbstractGenerator is an ABC that defines the API a Generator must provide to work with the existing G...
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 void set_generatorparam_value(const std::string &name, const std::string &value)=0
Set the value for a specific GeneratorParam for an AbstractGenerator instance.
void set_generatorparam_values(const GeneratorParamsMap &m)
virtual std::vector< ArgInfo > arginfos()=0
Return a list of all the ArgInfos for this generator.
A class representing a Halide pipeline.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
std::map< std::string, std::string > GeneratorParamsMap
@ Internal
Not visible externally, similar to 'static' linkage in C.
A set of custom overrides of runtime functions.
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...
std::vector< Type > types
std::unique_ptr< AbstractGenerator > AbstractGeneratorPtr
A reference to a site in a Halide statement at the top of the body of a particular for loop.
Module build_module(const std::string &function_name="")
Call generate() and produce a Module for the result.
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.
ArgInfo is a struct to contain name-and-type information for the inputs and outputs to the Pipeline t...
virtual Pipeline build_pipeline()=0
Build and return the Pipeline for this AbstractGenerator.
virtual std::string name()=0
Return the name of 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.
virtual std::vector< Parameter > input_parameter(const std::string &name)=0
Given the name of an input, return the Parameter(s) for that input.
virtual std::vector< Func > output_func(const std::string &name)=0
Given the name of an output, return the Func(s) for that output.