Halide
Halide::RVar Class Reference

A reduction variable represents a single dimension of a reduction domain (RDom). More...

#include <RDom.h>

Public Member Functions

 RVar ()
 An empty reduction variable. More...
 
 RVar (const std::string &n)
 Construct an RVar with the given name. More...
 
 RVar (Internal::ReductionDomain domain, int index)
 Construct a reduction variable with the given name and bounds. More...
 
Expr min () const
 The minimum value that this variable will take on. More...
 
Expr extent () const
 The number that this variable will take on. More...
 
Internal::ReductionDomain domain () const
 The reduction domain this is associated with. More...
 
const std::string & name () const
 The name of this reduction variable. More...
 
 operator Expr () const
 Reduction variables can be used as expressions. More...
 

Detailed Description

A reduction variable represents a single dimension of a reduction domain (RDom).

Don't construct them directly, instead construct an RDom, and use RDom::operator[] to get at the variables. For single-dimensional reduction domains, you can just cast a single-dimensional RDom to an RVar.

Definition at line 29 of file RDom.h.

Constructor & Destructor Documentation

◆ RVar() [1/3]

Halide::RVar::RVar ( )
inline

An empty reduction variable.

Definition at line 40 of file RDom.h.

References Halide::Internal.

◆ RVar() [2/3]

Halide::RVar::RVar ( const std::string &  n)
inlineexplicit

Construct an RVar with the given name.

Definition at line 45 of file RDom.h.

◆ RVar() [3/3]

Halide::RVar::RVar ( Internal::ReductionDomain  domain,
int  index 
)
inline

Construct a reduction variable with the given name and bounds.

Must be a member of the given reduction domain.

Definition at line 51 of file RDom.h.

Member Function Documentation

◆ min()

Expr Halide::RVar::min ( ) const

The minimum value that this variable will take on.

◆ extent()

Expr Halide::RVar::extent ( ) const

The number that this variable will take on.

The maximum value of this variable will be min() + extent() - 1

◆ domain()

Internal::ReductionDomain Halide::RVar::domain ( ) const
inline

The reduction domain this is associated with.

Definition at line 63 of file RDom.h.

◆ name()

const std::string& Halide::RVar::name ( ) const

The name of this reduction variable.

Referenced by Halide::VarOrRVar::name().

◆ operator Expr()

Halide::RVar::operator Expr ( ) const

Reduction variables can be used as expressions.


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