1#ifndef HALIDE_INTERNAL_AUTO_SCHEDULE_UTILS_H
2#define HALIDE_INTERNAL_AUTO_SCHEDULE_UTILS_H
29 void visit(
const Call *call)
override {
34 for (
const auto &arg : call->
args) {
41 std::vector<std::pair<std::string, std::vector<Expr>>>
call_args;
76 const std::map<std::string, Expr> &partial);
91 const std::set<std::string> &inlines = std::set<std::string>(),
92 const std::vector<std::string> &order = std::vector<std::string>());
100template<
typename K,
typename V>
102 const auto &iter = m.find(key);
107template<
typename K,
typename V>
109 const auto &iter = m.find(key);
118 const std::vector<std::string> &order,
119 const std::map<std::string, Function> &env);
125 const std::map<std::string, Function> &env);
130 const std::vector<std::string> &order,
131 const std::map<std::string, Function> &env);
Methods for computing the upper and lower bounds of an expression, and the regions of a function read...
Defines the internal representation of a halide function's definition and related classes.
#define internal_assert(c)
Defines the base class for things that recursively walk over the IR.
Defines the Interval class.
A Function definition which can either represent a init or an update definition.
Visitor for keeping track of functions that are directly called and the arguments with which they are...
std::vector< std::pair< std::string, std::vector< Expr > > > call_args
std::set< std::string > funcs_called
A reference-counted handle to Halide's internal representation of a function.
A base class for algorithms that need to recursively walk over the IR.
virtual void visit(const IntImm *)
Expr box_size(const Box &b)
Return the size of an n-d box.
std::set< std::string > get_parents(Function f, int stage)
Return all functions that are directly called by a function stage (f, stage).
std::string is_func_called_element_wise(const std::vector< std::string > &order, size_t index, const std::map< std::string, Function > &env)
Determine if a Func (order[index]) is only consumed by another single Func in element-wise manner.
Expr perform_inline(Expr e, const std::map< std::string, Function > &env, const std::set< std::string > &inlines=std::set< std::string >(), const std::vector< std::string > &order=std::vector< std::string >())
Recursively inline all the functions in the set 'inlines' into the expression 'e' and return the resu...
DimBounds get_stage_bounds(const Function &f, int stage_num, const DimBounds &pure_bounds)
Return the required bounds of an intermediate stage (f, stage_num) of function 'f' given the bounds o...
Definition get_stage_definition(const Function &f, int stage_num)
Return the corresponding definition of a function given the stage.
Expr substitute_var_estimates(Expr e)
Substitute every variable in an Expr or a Stmt with its estimate if specified.
std::vector< Dim > & get_stage_dims(const Function &f, int stage_num)
Return the corresponding loop dimensions of a function given the stage.
void disp_regions(const std::map< std::string, Box > ®ions)
Helper function to print the bounds of a region.
void propagate_estimate_test()
void combine_load_costs(std::map< std::string, Expr > &result, const std::map< std::string, Expr > &partial)
Add partial load costs to the corresponding function in the result costs.
V get_element(const std::map< K, V > &m, const K &key)
Return value of element within a map.
Expr get_extent(const Interval &i)
Return the size of an interval.
bool inline_all_trivial_functions(const std::vector< Function > &outputs, const std::vector< std::string > &order, const std::map< std::string, Function > &env)
If the cost of computing a Func is about the same as calling the Func, inline the Func.
std::map< std::string, Interval > DimBounds
int string_to_int(const std::string &s)
Return an int representation of 's'.
bool inline_all_element_wise_functions(const std::vector< Function > &outputs, const std::vector< std::string > &order, const std::map< std::string, Function > &env)
Inline a Func if its values are only consumed by another single Func in element-wise manner.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
signed __INT64_TYPE__ int64_t
A fragment of Halide syntax.
Represents the bounds of a region of arbitrary dimension.
@ Image
A load from an input image.
@ Halide
A call to a Func.
A class to represent ranges of Exprs.
A reference-counted handle to a statement node.