Halide
|
A Function definition which can either represent a init or an update definition. More...
#include <Definition.h>
Public Member Functions | |
Definition (const IntrusivePtr< DefinitionContents > &) | |
Construct a Definition from an existing DefinitionContents pointer. More... | |
Definition (const std::vector< Expr > &args, const std::vector< Expr > &values, const ReductionDomain &rdom, bool is_init) | |
Construct a Definition with the supplied args, values, and reduction domain. More... | |
Definition () | |
Construct an undefined Definition object. More... | |
Definition | get_copy () const |
Return a copy of this Definition. More... | |
bool | same_as (const Definition &other) const |
Equality of identity. More... | |
bool | defined () const |
Definition objects are nullable. More... | |
bool | is_init () const |
Is this an init definition; otherwise it's an update definition. More... | |
void | accept (IRVisitor *) const |
Pass an IRVisitor through to all Exprs referenced in the definition. More... | |
void | mutate (IRMutator *) |
Pass an IRMutator through to all Exprs referenced in the definition. More... | |
const std::vector< Expr > & | args () const |
Get the default (no-specialization) arguments (left-hand-side) of the definition. More... | |
std::vector< Expr > & | args () |
const std::vector< Expr > & | values () const |
Get the default (no-specialization) right-hand-side of the definition. More... | |
std::vector< Expr > & | values () |
const Expr & | predicate () const |
Get the predicate on the definition. More... | |
Expr & | predicate () |
std::vector< Expr > | split_predicate () const |
Split predicate into vector of ANDs. More... | |
const StageSchedule & | schedule () const |
Get the default (no-specialization) stage-specific schedule associated with this definition. More... | |
StageSchedule & | schedule () |
const std::vector< Specialization > & | specializations () const |
You may create several specialized versions of a func with different stage-specific schedules. More... | |
std::vector< Specialization > & | specializations () |
const Specialization & | add_specialization (Expr condition) |
std::string | source_location () const |
Attempt to get the source file and line where this definition was made using DWARF introspection. More... | |
A Function definition which can either represent a init or an update definition.
A function may have different definitions due to specialization, which are stored in 'specializations' (Not possible from the front-end, but some scheduling directives may potentially cause this divergence to occur). Although init definition may have multiple values (RHS) per specialization, it must have the same LHS (i.e. same pure dimension variables). The update definition, on the other hand, may have different LHS/RHS per specialization. Note that, while the Expr in LHS/RHS may be different across specializations, they must have the same number of dimensions and the same pure dimensions.
Definition at line 38 of file Definition.h.
|
explicit |
Construct a Definition from an existing DefinitionContents pointer.
Must be non-null
Halide::Internal::Definition::Definition | ( | const std::vector< Expr > & | args, |
const std::vector< Expr > & | values, | ||
const ReductionDomain & | rdom, | ||
bool | is_init | ||
) |
Construct a Definition with the supplied args, values, and reduction domain.
Halide::Internal::Definition::Definition | ( | ) |
Construct an undefined Definition object.
Definition Halide::Internal::Definition::get_copy | ( | ) | const |
Return a copy of this Definition.
|
inline |
Equality of identity.
Definition at line 57 of file Definition.h.
References Halide::Internal::IntrusivePtr< T >::same_as().
bool Halide::Internal::Definition::defined | ( | ) | const |
bool Halide::Internal::Definition::is_init | ( | ) | const |
Is this an init definition; otherwise it's an update definition.
void Halide::Internal::Definition::accept | ( | IRVisitor * | ) | const |
Pass an IRVisitor through to all Exprs referenced in the definition.
void Halide::Internal::Definition::mutate | ( | IRMutator * | ) |
Pass an IRMutator through to all Exprs referenced in the definition.
const std::vector<Expr>& Halide::Internal::Definition::args | ( | ) | const |
Get the default (no-specialization) arguments (left-hand-side) of the definition.
Referenced by Halide::Stage::Stage().
std::vector<Expr>& Halide::Internal::Definition::args | ( | ) |
const std::vector<Expr>& Halide::Internal::Definition::values | ( | ) | const |
Get the default (no-specialization) right-hand-side of the definition.
std::vector<Expr>& Halide::Internal::Definition::values | ( | ) |
const Expr& Halide::Internal::Definition::predicate | ( | ) | const |
Get the predicate on the definition.
Expr& Halide::Internal::Definition::predicate | ( | ) |
std::vector<Expr> Halide::Internal::Definition::split_predicate | ( | ) | const |
Split predicate into vector of ANDs.
If there is no predicate (i.e. this definition is always valid), this returns an empty vector.
const StageSchedule& Halide::Internal::Definition::schedule | ( | ) | const |
Get the default (no-specialization) stage-specific schedule associated with this definition.
Referenced by Halide::Stage::get_schedule().
StageSchedule& Halide::Internal::Definition::schedule | ( | ) |
const std::vector<Specialization>& Halide::Internal::Definition::specializations | ( | ) | const |
You may create several specialized versions of a func with different stage-specific schedules.
They trigger when the condition is true. See Func::specialize
std::vector<Specialization>& Halide::Internal::Definition::specializations | ( | ) |
const Specialization& Halide::Internal::Definition::add_specialization | ( | Expr | condition | ) |
std::string Halide::Internal::Definition::source_location | ( | ) | const |
Attempt to get the source file and line where this definition was made using DWARF introspection.
Returns an empty string if no debug symbols were found or the debug symbols were not understood. Works on OS X and Linux only.