Halide 22.0.0 Halide compiler and libraries

Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Halide::Internal::Autoscheduler::State Struct Reference

`#include <State.h>`

## Classes
struct | FeatureLoopNestMutator

## Public Member Functions
| State ()=default
| State (const State &)=delete
| State (State &&)=delete
void | operator= (const State &)=delete
void | operator= (State &&)=delete
uint64_t | structural_hash (int depth) const
void | compute_featurization (const FunctionDAG &dag, const Adams2019Params &params, StageMap< ScheduleFeatures > *features, const CachingOptions &cache_options)
void | save_featurization (const FunctionDAG &dag, const Adams2019Params &params, const CachingOptions &cache_options, std::ostream &out)
bool | calculate_cost (const FunctionDAG &dag, const Adams2019Params &params, CostModel *cost_model, const CachingOptions &cache_options, int verbosity=99)
IntrusivePtr< State > | make_child () const
void | generate_children (const FunctionDAG &dag, const Adams2019Params &params, CostModel *cost_model, std::function< void(IntrusivePtr< State > &&)> &accept_child, Cache *cache) const
void | dump (std::ostream &os) const
void | apply_schedule (const FunctionDAG &dag, const Adams2019Params &params)
| State ()=default
| State (const State &)=delete
| State (State &&)=delete
void | operator= (const State &)=delete
void | operator= (State &&)=delete
uint64_t | structural_hash (int depth) const
void | compute_loop_nest_parents (LoopNestMap &p, const LoopNest *here, int depth) const
const LoopNest * | deepest_common_ancestor (const LoopNestMap &parent, const LoopNest *a, const LoopNest *b) const
template<typename PostCreateMutator >
LoopNest * | create_feature_root (const PostCreateMutator &post_create_mutator) const
bool | has_loop_nest_without_thread_loops () const
bool | has_compute_root_loops_without_blocks () const
IntrusivePtr< const LoopNest > | get_root_for_features (const Anderson2021Params &params, const Target &target) const
void | set_gpu_store_site (const LoopNestMap &parent, const LoopNest *loop, LoopNest::Sites &site) const
bool | compute_featurization (const FunctionDAG &dag, const Anderson2021Params &params, const Target &target, StageMap< ScheduleFeatures > *features, Statistics &stats, bool verbose=false) const
void | save_featurization (const FunctionDAG &dag, const Anderson2021Params &params, const Target &target, std::ostream &out) const
bool | contains_store_at (const set< const FunctionDAG::Node * > &outermost_store_at, const IntrusivePtr< const LoopNest > &parent) const
bool | contains_store_at_further_in_than_outermost () const
bool | has_dynamic_allocation_inside_thread () const
bool | exceeds_serial_extents_limit (const Target &target) const
int64_t | get_shared_mem_alloc_size (const LoopNest *block, const LoopNest *loop) const
bool | exceeds_shared_memory_limit (const Anderson2021Params &params, const Target &target) const
bool | exceeds_local_memory_limit (const Anderson2021Params &params, const Target &target) const
bool | calculate_cost (const FunctionDAG &dag, const Anderson2021Params &params, const Target &target, CostModel *cost_model, Statistics &stats, bool verbose=false)
IntrusivePtr< State > | make_child () const
void | dump () const
void | print_compute_locations () const
void | fuse_gpu_blocks (LoopNest::StageScheduleState *state, Stage &stage, const vector< VarOrRVar > &parallel_vars, const vector< int64_t > &parallel_extents, const vector< int > &constant_extents) const
void | mark_gpu_blocks (LoopNest::StageScheduleState *state, Stage &stage, const vector< VarOrRVar > &parallel_vars, const vector< int64_t > &parallel_extents) const
bool | mark_gpu_threads (LoopNest::StageScheduleState *state, Stage &stage, std::unordered_set< std::string > &new_serial_vars, std::ostringstream &staged_funcs_schedule_source) const
bool | can_fuse_gpu (const vector< int64_t > &parallel_extents) const
void | apply_schedule (const FunctionDAG &dag, const Anderson2021Params &params, const Target &target)
bool | should_always_consider_inline (const FunctionDAG::Node *node) const
void | add_to_always_consider_inline_options (const FunctionDAG::Node *node)
void | update_always_consider_inline_options (const FunctionDAG::Node *node)
const LoopNest * | deepest_valid_compute_location (const Anderson2021Params &params, const LoopNestMap &parent, const FunctionDAG::Node &node, const LoopNest *loop, const LoopNest *root, StageMap< int64_t > &total_shared_mem_alloc_sizes) const
int64_t | total_loop_extents_of_ancestors (const LoopNestMap &parent, const LoopNest *loop) const

## Public Attributes
RefCount | ref_count
IntrusivePtr< const LoopNest > | root
IntrusivePtr< const State > | parent
double | cost = 0
int | num_decisions_made = 0
bool | penalized = false
string | schedule_source
std::vector< double > | cost_per_stage
NodeMap< bool > | always_consider_inline

## Static Public Attributes
static int | cost_calculations

## Detailed Description

Definition at line 21 of file State.h.

## Constructor & Destructor Documentation

## ◆ State() [1/6]

Halide::Internal::Autoscheduler::State::State | ( |  | ) |
| default

## ◆ State() [2/6]

Halide::Internal::Autoscheduler::State::State | ( | const State & |  | ) |
| delete

## ◆ State() [3/6]

Halide::Internal::Autoscheduler::State::State | ( | State && |  | ) |
| delete

## ◆ State() [4/6]

Halide::Internal::Autoscheduler::State::State | ( |  | ) |
| default

## ◆ State() [5/6]

Halide::Internal::Autoscheduler::State::State | ( | const State & |  | ) |
| delete

## ◆ State() [6/6]

Halide::Internal::Autoscheduler::State::State | ( | State && |  | ) |
| delete

## Member Function Documentation

## ◆ operator=() [1/4]

void Halide::Internal::Autoscheduler::State::operator= | ( | const State & |  | ) |
| delete

## ◆ operator=() [2/4]

void Halide::Internal::Autoscheduler::State::operator= | ( | State && |  | ) |
| delete

## ◆ structural_hash() [1/2]

uint64_t Halide::Internal::Autoscheduler::State::structural_hash | ( | int | depth | ) | const

## ◆ compute_featurization() [1/2]

void Halide::Internal::Autoscheduler::State::compute_featurization | ( | const FunctionDAG & | dag,
|  | const Adams2019Params & | params,
|  | StageMap< ScheduleFeatures > * | features,
|  | const CachingOptions & | cache_options
| ) |  |

## ◆ save_featurization() [1/2]

void Halide::Internal::Autoscheduler::State::save_featurization | ( | const FunctionDAG & | dag,
|  | const Adams2019Params & | params,
|  | const CachingOptions & | cache_options,
|  | std::ostream & | out
| ) |  |

## ◆ calculate_cost() [1/2]

bool Halide::Internal::Autoscheduler::State::calculate_cost | ( | const FunctionDAG & | dag,
|  | const Adams2019Params & | params,
|  | CostModel * | cost_model,
|  | const CachingOptions & | cache_options,
|  | int | verbosity = `99`
| ) |  |

## ◆ make_child() [1/2]

IntrusivePtr< State > Halide::Internal::Autoscheduler::State::make_child | ( |  | ) | const

## ◆ generate_children()

void Halide::Internal::Autoscheduler::State::generate_children | ( | const FunctionDAG & | dag,
|  | const Adams2019Params & | params,
|  | CostModel * | cost_model,
|  | std::function< void(IntrusivePtr< State > &&)> & | accept_child,
|  | Cache * | cache
| ) |  | const

## ◆ dump() [1/2]

void Halide::Internal::Autoscheduler::State::dump | ( | std::ostream & | os | ) | const

## ◆ apply_schedule() [1/2]

void Halide::Internal::Autoscheduler::State::apply_schedule | ( | const FunctionDAG & | dag,
|  | const Adams2019Params & | params
| ) |  |

## ◆ operator=() [3/4]

void Halide::Internal::Autoscheduler::State::operator= | ( | const State & |  | ) |
| delete

## ◆ operator=() [4/4]

void Halide::Internal::Autoscheduler::State::operator= | ( | State && |  | ) |
| delete

## ◆ structural_hash() [2/2]

uint64_t Halide::Internal::Autoscheduler::State::structural_hash | ( | int | depth | ) | const

## ◆ compute_loop_nest_parents()

void Halide::Internal::Autoscheduler::State::compute_loop_nest_parents | ( | LoopNestMap & | p,
|  | const LoopNest * | here,
|  | int | depth
| ) |  | const

## ◆ deepest_common_ancestor()

const LoopNest * Halide::Internal::Autoscheduler::State::deepest_common_ancestor | ( | const LoopNestMap & | parent,
|  | const LoopNest * | a,
|  | const LoopNest * | b
| ) |  | const

## ◆ create_feature_root()

template<typename PostCreateMutator >

LoopNest * Halide::Internal::Autoscheduler::State::create_feature_root | ( | const PostCreateMutator & | post_create_mutator | ) | const
| inline

Definition at line 106 of file State.h.

References root.

## ◆ has_loop_nest_without_thread_loops()

bool Halide::Internal::Autoscheduler::State::has_loop_nest_without_thread_loops | ( |  | ) | const

## ◆ has_compute_root_loops_without_blocks()

bool Halide::Internal::Autoscheduler::State::has_compute_root_loops_without_blocks | ( |  | ) | const

## ◆ get_root_for_features()

IntrusivePtr< const LoopNest > Halide::Internal::Autoscheduler::State::get_root_for_features | ( | const Anderson2021Params & | params,
|  | const Target & | target
| ) |  | const

## ◆ set_gpu_store_site()

void Halide::Internal::Autoscheduler::State::set_gpu_store_site | ( | const LoopNestMap & | parent,
|  | const LoopNest * | loop,
|  | LoopNest::Sites & | site
| ) |  | const

## ◆ compute_featurization() [2/2]

bool Halide::Internal::Autoscheduler::State::compute_featurization | ( | const FunctionDAG & | dag,
|  | const Anderson2021Params & | params,
|  | const Target & | target,
|  | StageMap< ScheduleFeatures > * | features,
|  | Statistics & | stats,
|  | bool | verbose = `false`
| ) |  | const

## ◆ save_featurization() [2/2]

void Halide::Internal::Autoscheduler::State::save_featurization | ( | const FunctionDAG & | dag,
|  | const Anderson2021Params & | params,
|  | const Target & | target,
|  | std::ostream & | out
| ) |  | const

## ◆ contains_store_at()

bool Halide::Internal::Autoscheduler::State::contains_store_at | ( | const set< const FunctionDAG::Node * > & | outermost_store_at,
|  | const IntrusivePtr< const LoopNest > & | parent
| ) |  | const

## ◆ contains_store_at_further_in_than_outermost()

bool Halide::Internal::Autoscheduler::State::contains_store_at_further_in_than_outermost | ( |  | ) | const

## ◆ has_dynamic_allocation_inside_thread()

bool Halide::Internal::Autoscheduler::State::has_dynamic_allocation_inside_thread | ( |  | ) | const

## ◆ exceeds_serial_extents_limit()

bool Halide::Internal::Autoscheduler::State::exceeds_serial_extents_limit | ( | const Target & | target | ) | const

## ◆ get_shared_mem_alloc_size()

int64_t Halide::Internal::Autoscheduler::State::get_shared_mem_alloc_size | ( | const LoopNest * | block,
|  | const LoopNest * | loop
| ) |  | const

## ◆ exceeds_shared_memory_limit()

bool Halide::Internal::Autoscheduler::State::exceeds_shared_memory_limit | ( | const Anderson2021Params & | params,
|  | const Target & | target
| ) |  | const

## ◆ exceeds_local_memory_limit()

bool Halide::Internal::Autoscheduler::State::exceeds_local_memory_limit | ( | const Anderson2021Params & | params,
|  | const Target & | target
| ) |  | const

## ◆ calculate_cost() [2/2]

bool Halide::Internal::Autoscheduler::State::calculate_cost | ( | const FunctionDAG & | dag,
|  | const Anderson2021Params & | params,
|  | const Target & | target,
|  | CostModel * | cost_model,
|  | Statistics & | stats,
|  | bool | verbose = `false`
| ) |  |

## ◆ make_child() [2/2]

IntrusivePtr< State > Halide::Internal::Autoscheduler::State::make_child | ( |  | ) | const

## ◆ dump() [2/2]

void Halide::Internal::Autoscheduler::State::dump | ( |  | ) | const

## ◆ print_compute_locations()

void Halide::Internal::Autoscheduler::State::print_compute_locations | ( |  | ) | const

## ◆ fuse_gpu_blocks()

void Halide::Internal::Autoscheduler::State::fuse_gpu_blocks | ( | LoopNest::StageScheduleState * | state,
|  | Stage & | stage,
|  | const vector< VarOrRVar > & | parallel_vars,
|  | const vector< int64_t > & | parallel_extents,
|  | const vector< int > & | constant_extents
| ) |  | const

## ◆ mark_gpu_blocks()

void Halide::Internal::Autoscheduler::State::mark_gpu_blocks | ( | LoopNest::StageScheduleState * | state,
|  | Stage & | stage,
|  | const vector< VarOrRVar > & | parallel_vars,
|  | const vector< int64_t > & | parallel_extents
| ) |  | const

## ◆ mark_gpu_threads()

bool Halide::Internal::Autoscheduler::State::mark_gpu_threads | ( | LoopNest::StageScheduleState * | state,
|  | Stage & | stage,
|  | std::unordered_set< std::string > & | new_serial_vars,
|  | std::ostringstream & | staged_funcs_schedule_source
| ) |  | const

## ◆ can_fuse_gpu()

bool Halide::Internal::Autoscheduler::State::can_fuse_gpu | ( | const vector< int64_t > & | parallel_extents | ) | const

## ◆ apply_schedule() [2/2]

void Halide::Internal::Autoscheduler::State::apply_schedule | ( | const FunctionDAG & | dag,
|  | const Anderson2021Params & | params,
|  | const Target & | target
| ) |  |

## ◆ should_always_consider_inline()

bool Halide::Internal::Autoscheduler::State::should_always_consider_inline | ( | const FunctionDAG::Node * | node | ) | const

## ◆ add_to_always_consider_inline_options()

void Halide::Internal::Autoscheduler::State::add_to_always_consider_inline_options | ( | const FunctionDAG::Node * | node | ) |

## ◆ update_always_consider_inline_options()

void Halide::Internal::Autoscheduler::State::update_always_consider_inline_options | ( | const FunctionDAG::Node * | node | ) |

## ◆ deepest_valid_compute_location()

const LoopNest * Halide::Internal::Autoscheduler::State::deepest_valid_compute_location | ( | const Anderson2021Params & | params,
|  | const LoopNestMap & | parent,
|  | const FunctionDAG::Node & | node,
|  | const LoopNest * | loop,
|  | const LoopNest * | root,
|  | StageMap< int64_t > & | total_shared_mem_alloc_sizes
| ) |  | const

## ◆ total_loop_extents_of_ancestors()

int64_t Halide::Internal::Autoscheduler::State::total_loop_extents_of_ancestors | ( | const LoopNestMap & | parent,
|  | const LoopNest * | loop
| ) |  | const

## Member Data Documentation

## ◆ ref_count

RefCount Halide::Internal::Autoscheduler::State::ref_count
| mutable

Definition at line 22 of file State.h.

## ◆ root

IntrusivePtr< const LoopNest > Halide::Internal::Autoscheduler::State::root

Definition at line 24 of file State.h.

Referenced by create_feature_root().

## ◆ parent

IntrusivePtr< const State > Halide::Internal::Autoscheduler::State::parent

Definition at line 26 of file State.h.

## ◆ cost

double Halide::Internal::Autoscheduler::State::cost = 0

Definition at line 28 of file State.h.

## ◆ num_decisions_made

int Halide::Internal::Autoscheduler::State::num_decisions_made = 0

Definition at line 30 of file State.h.

## ◆ penalized

bool Halide::Internal::Autoscheduler::State::penalized = false

Definition at line 32 of file State.h.

## ◆ schedule_source

string Halide::Internal::Autoscheduler::State::schedule_source

Definition at line 36 of file State.h.

## ◆ cost_calculations

int Halide::Internal::Autoscheduler::State::cost_calculations
| static

Definition at line 40 of file State.h.

## ◆ cost_per_stage

std::vector<double> Halide::Internal::Autoscheduler::State::cost_per_stage

Definition at line 80 of file State.h.

## ◆ always_consider_inline

NodeMap<bool> Halide::Internal::Autoscheduler::State::always_consider_inline

Definition at line 81 of file State.h.

The documentation for this struct was generated from the following files:

- src/autoschedulers/adams2019/State.h
- src/autoschedulers/anderson2021/State.h