Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::ReductionDomain Class Reference

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< Exprsplit_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.
 

Detailed Description

A reference-counted handle on a reduction domain, which is just a vector of ReductionVariable.

Definition at line 33 of file Reduction.h.

Constructor & Destructor Documentation

◆ ReductionDomain() [1/3]

Halide::Internal::ReductionDomain::ReductionDomain ( )
inline

Construct a new nullptr reduction domain.

Definition at line 47 of file Reduction.h.

◆ ReductionDomain() [2/3]

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.

◆ ReductionDomain() [3/3]

Halide::Internal::ReductionDomain::ReductionDomain ( const std::vector< ReductionVariable > & domain,
const Expr & predicate,
bool frozen )

Construct a reduction domain from deserialization.

Member Function Documentation

◆ deep_copy()

ReductionDomain Halide::Internal::ReductionDomain::deep_copy ( ) const

Return a deep copy of this ReductionDomain.

◆ defined()

bool Halide::Internal::ReductionDomain::defined ( ) const
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().

◆ same_as()

bool Halide::Internal::ReductionDomain::same_as ( const ReductionDomain & other) const
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().

◆ domain()

const std::vector< ReductionVariable > & Halide::Internal::ReductionDomain::domain ( ) const

Immutable access to the reduction variables.

◆ where()

void Halide::Internal::ReductionDomain::where ( Expr predicate)

Add predicate to the reduction domain.

See RDom::where for more details.

◆ predicate()

Expr Halide::Internal::ReductionDomain::predicate ( ) const

Return the predicate defined on this reducation demain.

◆ set_predicate()

void Halide::Internal::ReductionDomain::set_predicate ( const Expr & )

Set the predicate, replacing any previously set predicate.

◆ split_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.

◆ freeze()

void Halide::Internal::ReductionDomain::freeze ( )

Mark RDom as frozen, which means it cannot accept new predicates.

An RDom is frozen once it is used in a Func's update definition.

◆ frozen()

bool Halide::Internal::ReductionDomain::frozen ( ) const

Check if a RDom has been frozen.

If so, it is an error to add new predicates.

◆ accept()

void Halide::Internal::ReductionDomain::accept ( IRVisitor * ) const

Pass an IRVisitor through to all Exprs referenced in the ReductionDomain.

◆ mutate()

void Halide::Internal::ReductionDomain::mutate ( IRMutator * )

Pass an IRMutator through to all Exprs referenced in the ReductionDomain.


The documentation for this class was generated from the following file: