Go to the documentation of this file. 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;
62 void disp_regions(
const std::map<std::string, Box> ®ions);
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>());
100 template<
typename K,
typename V>
102 const auto &iter = m.find(key);
107 template<
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);
#define internal_assert(c)
virtual void visit(const IntImm *)
std::vector< std::pair< std::string, std::vector< Expr > > > call_args
A base class for algorithms that need to recursively walk over the IR.
Visitor for keeping track of functions that are directly called and the arguments with which they are...
Expr min(const FuncRef &a, const FuncRef &b)
Explicit overloads of min and max for FuncRef.
Expr substitute_var_estimates(Expr e)
Substitute every variable in an Expr or a Stmt with its estimate if specified.
std::map< std::string, Interval > DimBounds
std::set< std::string > get_parents(Function f, int stage)
Return all functions that are directly called by a function stage (f, stage).
@ Halide
A call to a Func.
A Function definition which can either represent a init or an update definition.
std::set< std::string > funcs_called
A reference-counted handle to a statement node.
Expr get_extent(const Interval &i)
Return the size of an interval.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Image
A load from an input image.
@ Internal
Not visible externally, similar to 'static' linkage in C.
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.
V get_element(const std::map< K, V > &m, const K &key)
Return value of element within a map.
std::vector< Dim > & get_stage_dims(const Function &f, int stage_num)
Return the corresponding loop dimensions of a function given the stage.
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.
signed __INT64_TYPE__ int64_t
Expr box_size(const Box &b)
Return the size of an n-d box.
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...
A class to represent ranges of Exprs.
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.
A reference-counted handle to Halide's internal representation of a function.
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...
void disp_regions(const std::map< std::string, Box > ®ions)
Helper function to print the bounds of a region.
A fragment of Halide syntax.
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.
void propagate_estimate_test()
int string_to_int(const std::string &s)
Return an int representation of 's'.
Represents the bounds of a region of arbitrary dimension.
Definition get_stage_definition(const Function &f, int stage_num)
Return the corresponding definition of a function given the stage.