RVar#

class RVar#

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.

Public Functions

inline RVar()#

An empty reduction variable.

inline explicit RVar(const std::string &n)#

Construct an RVar with the given name.

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

Construct a reduction variable with the given name and bounds.

Must be a member of the given reduction domain.

Expr min() const#

The minimum value that this variable will take on.

Expr extent() const#

The number that this variable will take on.

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

inline Internal::ReductionDomain domain() const#

The reduction domain this is associated with.

const std::string &name() const#

The name of this reduction variable.

operator Expr() const#

Reduction variables can be used as expressions.