Internal::Definition#
-
class Definition#
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.
Public Functions
-
explicit Definition(const IntrusivePtr<DefinitionContents>&)#
Construct a Definition from an existing DefinitionContents pointer.
Must be non-null
-
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.
-
inline bool same_as(const Definition &other) const#
Equality of identity.
-
bool defined() const#
Definition objects are nullable.
Does this definition exist?
-
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.
-
const std::vector<Expr> &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.
-
const std::vector<Expr> &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> 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 &schedule() const#
Get the default (no-specialization) stage-specific schedule associated with this definition.
-
const std::vector<Specialization> &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
-
explicit Definition(const IntrusivePtr<DefinitionContents>&)#