1#ifndef HALIDE_REDUCTION_H
2#define HALIDE_REDUCTION_H
29struct ReductionDomainContents;
42 return a.contents < b.contents;
72 return contents.
same_as(other.contents);
76 const std::vector<ReductionVariable> &
domain()
const;
#define internal_assert(c)
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
A base class for passes over the IR which modify it (e.g.
A base class for algorithms that need to recursively walk over the IR.
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.
void freeze()
Mark RDom as frozen, which means it cannot accept new predicates.
std::vector< Expr > split_predicate() const
Split predicate into vector of ANDs.
bool defined() const
Is this handle non-nullptr.
void set_predicate(const Expr &)
Set the predicate, replacing any previously set predicate.
ReductionDomain deep_copy() const
Return a deep copy of this ReductionDomain.
const std::vector< ReductionVariable > & domain() const
Immutable access to the reduction variables.
ReductionDomain(const std::vector< ReductionVariable > &domain, const Expr &predicate, bool frozen)
Construct a reduction domain from deserialization.
Expr predicate() const
Return the predicate defined on this reduction domain.
void accept(IRVisitor *) const
Pass an IRVisitor through to all Exprs referenced in the ReductionDomain.
ReductionDomain()
Construct a new nullptr reduction domain.
ReductionDomain(const std::vector< ReductionVariable > &domain)
Construct a reduction domain that spans the outer product of all values of the given ReductionVariabl...
bool frozen() const
Check if a RDom has been frozen.
void where(Expr predicate)
Add predicate to the reduction domain.
void mutate(IRMutator *)
Pass an IRMutator through to all Exprs referenced in the ReductionDomain.
bool same_as(const ReductionDomain &other) const
Tests for equality of reference.
void split_predicate_test()
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
Intrusive shared pointers have a reference count (a RefCount object) stored in the class itself.
HALIDE_ALWAYS_INLINE bool defined() const
HALIDE_ALWAYS_INLINE bool same_as(const IntrusivePtr &other) const
This lets you use a ReductionDomain as a key in a map of the form map<ReductionDomain,...
bool operator()(const ReductionDomain &a, const ReductionDomain &b) const
This lets you use a ReductionVariable as a key in a map of the form map<ReductionVariable,...
bool operator()(const ReductionVariable &a, const ReductionVariable &b) const
A single named dimension of a reduction domain.