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...
 
EXPORT Expr min () const
 The minimum value that this variable will take on. More...
 
EXPORT Expr extent () const
 The number that this variable will take on. More...
 
EXPORT Internal::ReductionDomain domain () const
 The reduction domain this is associated with. More...
 
EXPORT const std::string & name () const
 The name of this reduction variable. More...
 
EXPORT 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 22 of file RDom.h.

Constructor & Destructor Documentation

◆ RVar() [1/3]

Halide::RVar::RVar ( )
inline

An empty reduction variable.

Definition at line 33 of file RDom.h.

Referenced by Halide::RDom::same_as().

◆ RVar() [2/3]

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

Construct an RVar with the given name.

Definition at line 36 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 41 of file RDom.h.

References EXPORT, extent(), and min().

Member Function Documentation

◆ min()

EXPORT Expr Halide::RVar::min ( ) const

The minimum value that this variable will take on.

Referenced by RVar().

◆ extent()

EXPORT Expr Halide::RVar::extent ( ) const

The number that this variable will take on.

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

Referenced by RVar().

◆ domain()

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

The reduction domain this is associated with.

Definition at line 53 of file RDom.h.

References EXPORT, and name().

◆ name()

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

The name of this reduction variable.

Referenced by domain(), and Halide::VarOrRVar::name().

◆ operator Expr()

EXPORT Halide::RVar::operator Expr ( ) const

Reduction variables can be used as expressions.


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