Halide 19.0.0
Halide compiler and libraries
|
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable. More...
#include <Reduction.h>
Classes | |
struct | Compare |
This lets you use a ReductionDomain as a key in a map of the form map<ReductionDomain, Foo, ReductionDomain::Compare> More... | |
Public Member Functions | |
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 ReductionVariable in scanline order, with the start of the vector being innermost, and the end of the vector being outermost. | |
ReductionDomain (const std::vector< ReductionVariable > &domain, const Expr &predicate, bool frozen) | |
Construct a reduction domain from deserialization. | |
ReductionDomain | deep_copy () const |
Return a deep copy of this ReductionDomain. | |
bool | defined () const |
Is this handle non-nullptr. | |
bool | same_as (const ReductionDomain &other) const |
Tests for equality of reference. | |
const std::vector< ReductionVariable > & | domain () const |
Immutable access to the reduction variables. | |
void | where (Expr predicate) |
Add predicate to the reduction domain. | |
Expr | predicate () const |
Return the predicate defined on this reducation demain. | |
void | set_predicate (const Expr &) |
Set the predicate, replacing any previously set predicate. | |
std::vector< Expr > | split_predicate () const |
Split predicate into vector of ANDs. | |
void | freeze () |
Mark RDom as frozen, which means it cannot accept new predicates. | |
bool | frozen () const |
Check if a RDom has been frozen. | |
void | accept (IRVisitor *) const |
Pass an IRVisitor through to all Exprs referenced in the ReductionDomain. | |
void | mutate (IRMutator *) |
Pass an IRMutator through to all Exprs referenced in the ReductionDomain. | |
A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.
Definition at line 33 of file Reduction.h.
|
inline |
Construct a new nullptr reduction domain.
Definition at line 47 of file Reduction.h.
Halide::Internal::ReductionDomain::ReductionDomain | ( | const std::vector< ReductionVariable > & | domain | ) |
Construct a reduction domain that spans the outer product of all values of the given ReductionVariable in scanline order, with the start of the vector being innermost, and the end of the vector being outermost.
Halide::Internal::ReductionDomain::ReductionDomain | ( | const std::vector< ReductionVariable > & | domain, |
const Expr & | predicate, | ||
bool | frozen ) |
Construct a reduction domain from deserialization.
ReductionDomain Halide::Internal::ReductionDomain::deep_copy | ( | ) | const |
Return a deep copy of this ReductionDomain.
|
inline |
Is this handle non-nullptr.
Definition at line 64 of file Reduction.h.
References Halide::Internal::IntrusivePtr< T >::defined().
Referenced by Halide::RDom::defined().
|
inline |
Tests for equality of reference.
Only one reduction domain is allowed per reduction function, and this is used to verify that
Definition at line 71 of file Reduction.h.
References Halide::Internal::IntrusivePtr< T >::same_as().
Referenced by Halide::RDom::same_as().
const std::vector< ReductionVariable > & Halide::Internal::ReductionDomain::domain | ( | ) | const |
Immutable access to the reduction variables.
void Halide::Internal::ReductionDomain::where | ( | Expr | predicate | ) |
Add predicate to the reduction domain.
See RDom::where for more details.
Expr Halide::Internal::ReductionDomain::predicate | ( | ) | const |
Return the predicate defined on this reducation demain.
void Halide::Internal::ReductionDomain::set_predicate | ( | const Expr & | ) |
Set the predicate, replacing any previously set predicate.
std::vector< Expr > Halide::Internal::ReductionDomain::split_predicate | ( | ) | const |
Split predicate into vector of ANDs.
If there is no predicate (i.e. all iteration domain in this reduction domain is valid), this returns an empty vector.
void Halide::Internal::ReductionDomain::freeze | ( | ) |
bool Halide::Internal::ReductionDomain::frozen | ( | ) | const |
Check if a RDom has been frozen.
If so, it is an error to add new predicates.
void Halide::Internal::ReductionDomain::accept | ( | IRVisitor * | ) | const |
Pass an IRVisitor through to all Exprs referenced in the ReductionDomain.
void Halide::Internal::ReductionDomain::mutate | ( | IRMutator * | ) |
Pass an IRMutator through to all Exprs referenced in the ReductionDomain.