Halide 19.0.0
Halide compiler and libraries
|
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. | |
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. | |
Definition (bool is_init, const Expr &predicate, const std::vector< Expr > &args, const std::vector< Expr > &values, const StageSchedule &schedule, const std::vector< Specialization > &specializations) | |
Construct a Definition with deserialized data. | |
Definition () | |
Construct an undefined Definition object. | |
Definition | get_copy () const |
Return a copy of this Definition. | |
bool | same_as (const Definition &other) const |
Equality of identity. | |
bool | defined () const |
Definition objects are nullable. | |
bool | is_init () const |
Is this an init definition; otherwise it's an update definition. | |
void | accept (IRVisitor *) const |
Pass an IRVisitor through to all Exprs referenced in the definition. | |
void | mutate (IRMutator *) |
Pass an IRMutator through to all Exprs referenced in the definition. | |
const std::vector< Expr > & | args () const |
Get the default (no-specialization) arguments (left-hand-side) of the definition. | |
std::vector< Expr > & | args () |
const std::vector< Expr > & | values () const |
Get the default (no-specialization) right-hand-side of the definition. | |
std::vector< Expr > & | values () |
const Expr & | predicate () const |
Get the predicate on the definition. | |
Expr & | predicate () |
std::vector< Expr > | split_predicate () const |
Split predicate into vector of ANDs. | |
const StageSchedule & | schedule () const |
Get the default (no-specialization) stage-specific schedule associated with this definition. | |
StageSchedule & | schedule () |
const std::vector< Specialization > & | specializations () const |
You may create several specialized versions of a func with different stage-specific schedules. | |
std::vector< Specialization > & | specializations () |
const Specialization & | add_specialization (Expr condition) |
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 | ( | bool | is_init, |
const Expr & | predicate, | ||
const std::vector< Expr > & | args, | ||
const std::vector< Expr > & | values, | ||
const StageSchedule & | schedule, | ||
const std::vector< Specialization > & | specializations ) |
Construct a Definition with deserialized data.
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 61 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.
Warning: Any Vars in the Exprs are not qualified with the Func name, so the Exprs may contain names which collide with names provided by unique_name.
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.
Warning: Any Vars in the Exprs are not qualified with the Func name, so the Exprs may contain names which collide with names provided by unique_name.
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::SimdOpCheckTest::check_one(), and 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 | ) |