1#ifndef HALIDE_INTERNAL_DERIVATIVE_UTILS_H
2#define HALIDE_INTERNAL_DERIVATIVE_UTILS_H
25 const std::vector<std::string> &filter);
27 const std::vector<Var> &filter);
44 const std::map<std::string, Expr> &let_var_mapping,
45 const std::vector<std::string> &let_variables);
55 const std::vector<Box> &output_bounds);
57 const Box &output_bounds);
79 const std::string &new_var,
80 const std::string &var);
97 const std::string &name,
const Expr &replacement,
const Expr &expr);
103 const std::string &func_name,
const Expr &expr,
104 const std::map<std::string, Expr> &let_var_mapping);
110 const std::map<std::string, Expr> &let_var_mapping);
Methods for computing the upper and lower bounds of an expression, and the regions of a function read...
Automatic differentiation.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the front-end syntax for reduction domains and reduction variables.
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
Defines the Var - the front-end variable.
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.
A multi-dimensional domain over which to iterate.
Create a small array of Exprs for defining and calling functions with multiple outputs.
Expr substitute_call_arg_with_pure_arg(Func f, int variable_id, const Expr &e)
Replaces call to Func f in Expr e such that the call argument at variable_id is the pure argument.
std::vector< int > gather_variables(const Expr &expr, const std::vector< std::string > &filter)
Return a list of variables' indices that expr depends on and are in the filter.
std::vector< std::string > vars_to_strings(const std::vector< Var > &vars)
Return a list of variable names.
std::vector< std::pair< Expr, Expr > > box_to_vector(const Box &bounds)
Convert Box to vector of (min, extent)
std::vector< Expr > sort_expressions(const Expr &expr)
Topologically sort the expression graph expressed by expr.
bool equal(const RDom &bounds0, const RDom &bounds1)
Return true if bounds0 and bounds1 represent the same bounds.
bool is_calling_function(const std::string &func_name, const Expr &expr, const std::map< std::string, Expr > &let_var_mapping)
Return true if expr contains call to func_name.
std::map< std::string, BufferInfo > find_buffer_param_calls(const Func &func)
std::map< std::string, Box > inference_bounds(const std::vector< Func > &funcs, const std::vector< Box > &output_bounds)
Compute the bounds of funcs.
std::pair< bool, Expr > solve_inverse(Expr expr, const std::string &new_var, const std::string &var)
expr is new_var == f(var), solve for var == g(new_var) if multiple new_var corresponds to same var,...
std::map< std::string, ReductionVariableInfo > gather_rvariables(const Expr &expr)
ReductionDomain extract_rdom(const Expr &expr)
Return the reduction domain used by expr.
Expr add_let_expression(const Expr &expr, const std::map< std::string, Expr > &let_var_mapping, const std::vector< std::string > &let_variables)
Add necessary let expressions to expr.
Expr remove_let_definitions(const Expr &expr)
Remove all let definitions of expr.
std::set< std::string > find_implicit_variables(const Expr &expr)
Find all implicit variables in expr.
Expr substitute_rdom_predicate(const std::string &name, const Expr &replacement, const Expr &expr)
Substitute the variable.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
Represents the bounds of a region of arbitrary dimension.
Find all calls to image buffers and parameters in the function.
Return a list of reduction variables the expression or tuple depends on.
Types in the halide type system.