Halide 19.0.0
Halide compiler and libraries
|
Auto scheduling component which is used to assign costs for computing a region of a function or one of its stages. More...
#include <RegionCosts.h>
Public Member Functions | |
Cost | stage_region_cost (const std::string &func, int stage, const DimBounds &bounds, const std::set< std::string > &inlines=std::set< std::string >()) |
Return the cost of producing a region (specified by 'bounds') of a function stage (specified by 'func' and 'stage'). | |
Cost | stage_region_cost (const std::string &func, int stage, const Box ®ion, const std::set< std::string > &inlines=std::set< std::string >()) |
Return the cost of producing a region of a function stage (specified by 'func' and 'stage'). | |
Cost | region_cost (const std::string &func, const Box ®ion, const std::set< std::string > &inlines=std::set< std::string >()) |
Return the cost of producing a region of function 'func'. | |
Cost | region_cost (const std::map< std::string, Box > ®ions, const std::set< std::string > &inlines=std::set< std::string >()) |
Same as region_cost above but this computes the total cost of many function regions. | |
Cost | get_func_stage_cost (const Function &f, int stage, const std::set< std::string > &inlines=std::set< std::string >()) const |
Compute the cost of producing a single value by one stage of 'f'. | |
std::vector< Cost > | get_func_cost (const Function &f, const std::set< std::string > &inlines=std::set< std::string >()) |
Compute the cost of producing a single value by all stages of 'f'. | |
std::map< std::string, Expr > | stage_detailed_load_costs (const std::string &func, int stage, DimBounds &bounds, const std::set< std::string > &inlines=std::set< std::string >()) |
Computes the memory costs of computing a region (specified by 'bounds') of a function stage (specified by 'func' and 'stage'). | |
std::map< std::string, Expr > | stage_detailed_load_costs (const std::string &func, int stage, const std::set< std::string > &inlines=std::set< std::string >()) |
Return a map containing the costs incurred to access each of the functions required to produce a single value of a function stage. | |
std::map< std::string, Expr > | detailed_load_costs (const std::string &func, const Box ®ion, const std::set< std::string > &inlines=std::set< std::string >()) |
Same as stage_detailed_load_costs above but this computes the cost of a region of 'func'. | |
std::map< std::string, Expr > | detailed_load_costs (const std::map< std::string, Box > ®ions, const std::set< std::string > &inlines=std::set< std::string >()) |
Same as detailed_load_costs above but this computes the cost of many function regions and aggregates them. | |
Expr | region_size (const std::string &func, const Box ®ion) |
Return the size of the region of 'func' in bytes. | |
Expr | region_footprint (const std::map< std::string, Box > ®ions, const std::set< std::string > &inlined=std::set< std::string >()) |
Return the size of the peak amount of memory allocated in bytes. | |
Expr | input_region_size (const std::string &input, const Box ®ion) |
Return the size of the input region in bytes. | |
Expr | input_region_size (const std::map< std::string, Box > &input_regions) |
Return the total size of the many input regions in bytes. | |
void | disp_func_costs () |
Display the cost of each function in the pipeline. | |
RegionCosts (const std::map< std::string, Function > &env, const std::vector< std::string > &order) | |
Construct a region cost object for the pipeline. | |
Public Attributes | |
std::map< std::string, Function > | env |
An environment map which contains all functions in the pipeline. | |
std::vector< std::string > | order |
Realization order of functions in the pipeline. | |
std::map< std::string, std::vector< Cost > > | func_cost |
A map containing the cost of computing a value in each stage of a function. | |
std::map< std::string, Type > | inputs |
A map containing the types of all image inputs in the pipeline. | |
Scope< Interval > | input_estimates |
A scope containing the estimated min/extent values of ImageParams in the pipeline. | |
Auto scheduling component which is used to assign costs for computing a region of a function or one of its stages.
Definition at line 48 of file RegionCosts.h.
Halide::Internal::RegionCosts::RegionCosts | ( | const std::map< std::string, Function > & | env, |
const std::vector< std::string > & | order ) |
Construct a region cost object for the pipeline.
'env' is a map of all functions in the pipeline. 'order' is the realization order of functions in the pipeline. The first function to be realized comes first.
Cost Halide::Internal::RegionCosts::stage_region_cost | ( | const std::string & | func, |
int | stage, | ||
const DimBounds & | bounds, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Return the cost of producing a region (specified by 'bounds') of a function stage (specified by 'func' and 'stage').
'inlines' specifies names of all the inlined functions.
Cost Halide::Internal::RegionCosts::stage_region_cost | ( | const std::string & | func, |
int | stage, | ||
const Box & | region, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Return the cost of producing a region of a function stage (specified by 'func' and 'stage').
'inlines' specifies names of all the inlined functions.
Cost Halide::Internal::RegionCosts::region_cost | ( | const std::string & | func, |
const Box & | region, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Return the cost of producing a region of function 'func'.
This adds up the costs of all stages of 'func' required to produce the region. 'inlines' specifies names of all the inlined functions.
Cost Halide::Internal::RegionCosts::region_cost | ( | const std::map< std::string, Box > & | regions, |
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Same as region_cost above but this computes the total cost of many function regions.
Cost Halide::Internal::RegionCosts::get_func_stage_cost | ( | const Function & | f, |
int | stage, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) const |
Compute the cost of producing a single value by one stage of 'f'.
'inlines' specifies names of all the inlined functions.
std::vector< Cost > Halide::Internal::RegionCosts::get_func_cost | ( | const Function & | f, |
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Compute the cost of producing a single value by all stages of 'f'.
'inlines' specifies names of all the inlined functions. This returns a vector of costs. Each entry in the vector corresponds to a stage in 'f'.
std::map< std::string, Expr > Halide::Internal::RegionCosts::stage_detailed_load_costs | ( | const std::string & | func, |
int | stage, | ||
DimBounds & | bounds, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Computes the memory costs of computing a region (specified by 'bounds') of a function stage (specified by 'func' and 'stage').
This returns a map containing the costs incurred to access each of the functions required to produce 'func'.
std::map< std::string, Expr > Halide::Internal::RegionCosts::stage_detailed_load_costs | ( | const std::string & | func, |
int | stage, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Return a map containing the costs incurred to access each of the functions required to produce a single value of a function stage.
std::map< std::string, Expr > Halide::Internal::RegionCosts::detailed_load_costs | ( | const std::string & | func, |
const Box & | region, | ||
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Same as stage_detailed_load_costs above but this computes the cost of a region of 'func'.
std::map< std::string, Expr > Halide::Internal::RegionCosts::detailed_load_costs | ( | const std::map< std::string, Box > & | regions, |
const std::set< std::string > & | inlines = std::set< std::string >() ) |
Same as detailed_load_costs above but this computes the cost of many function regions and aggregates them.
Return the size of the region of 'func' in bytes.
Expr Halide::Internal::RegionCosts::region_footprint | ( | const std::map< std::string, Box > & | regions, |
const std::set< std::string > & | inlined = std::set< std::string >() ) |
Return the size of the peak amount of memory allocated in bytes.
This takes the realization (topological) order of the function regions and the early free mechanism into account while computing the peak footprint.
Expr Halide::Internal::RegionCosts::input_region_size | ( | const std::string & | input, |
const Box & | region ) |
Return the size of the input region in bytes.
Expr Halide::Internal::RegionCosts::input_region_size | ( | const std::map< std::string, Box > & | input_regions | ) |
Return the total size of the many input regions in bytes.
void Halide::Internal::RegionCosts::disp_func_costs | ( | ) |
Display the cost of each function in the pipeline.
std::map<std::string, Function> Halide::Internal::RegionCosts::env |
An environment map which contains all functions in the pipeline.
Definition at line 50 of file RegionCosts.h.
std::vector<std::string> Halide::Internal::RegionCosts::order |
Realization order of functions in the pipeline.
The first function to be realized comes first.
Definition at line 53 of file RegionCosts.h.
std::map<std::string, std::vector<Cost> > Halide::Internal::RegionCosts::func_cost |
A map containing the cost of computing a value in each stage of a function.
The number of entries in the vector is equal to the number of stages in the function.
Definition at line 57 of file RegionCosts.h.
std::map<std::string, Type> Halide::Internal::RegionCosts::inputs |
A map containing the types of all image inputs in the pipeline.
Definition at line 59 of file RegionCosts.h.
A scope containing the estimated min/extent values of ImageParams in the pipeline.
Definition at line 62 of file RegionCosts.h.