Halide
Halide::LoopLevel Class Reference

A reference to a site in a Halide statement at the top of the body of a particular for loop. More...

#include <Schedule.h>

Public Member Functions

 LoopLevel ()=default
 Construct an undefined LoopLevel. More...
 
EXPORT bool defined () const
 Return true iff the LoopLevel is defined. More...
 
EXPORT std::string func () const
 Return the Func name. More...
 
EXPORT VarOrRVar var () const
 Return the VarOrRVar. More...
 
EXPORT bool is_inline () const
 Test if a loop level corresponds to inlining the function. More...
 
EXPORT bool is_root () const
 Test if a loop level is 'root', which describes the site outside of all for loops. More...
 
EXPORT std::string to_string () const
 Return a string of the form func.var – note that this is safe to call for root or inline LoopLevels. More...
 
EXPORT bool match (const std::string &loop) const
 Compare this loop level against the variable name of a for loop, to see if this loop level refers to the site immediately inside this loop. More...
 
EXPORT bool match (const LoopLevel &other) const
 
EXPORT bool operator== (const LoopLevel &other) const
 Check if two loop levels are exactly the same. More...
 
bool operator!= (const LoopLevel &other) const
 
EXPORT LoopLevel (Internal::Function f, VarOrRVar v)
 Identify the loop nest corresponding to some dimension of some function. More...
 
EXPORT LoopLevel (Func f, VarOrRVar v)
 Identify the loop nest corresponding to some dimension of some function. More...
 

Static Public Member Functions

static EXPORT LoopLevel inlined ()
 inlined is a special LoopLevel value that implies that a function should be inlined away. More...
 
static EXPORT LoopLevel root ()
 root is a special LoopLevel value which represents the location outside of all for loops More...
 

Detailed Description

A reference to a site in a Halide statement at the top of the body of a particular for loop.

Evaluating a region of a halide function is done by generating a loop nest that spans its dimensions. We schedule the inputs to that function by recursively injecting realizations for them at particular sites in this loop nest. A LoopLevel identifies such a site.

Definition at line 98 of file Schedule.h.

Constructor & Destructor Documentation

◆ LoopLevel() [1/3]

EXPORT Halide::LoopLevel::LoopLevel ( Internal::Function  f,
VarOrRVar  v 
)

Identify the loop nest corresponding to some dimension of some function.

◆ LoopLevel() [2/3]

EXPORT Halide::LoopLevel::LoopLevel ( Func  f,
VarOrRVar  v 
)

Identify the loop nest corresponding to some dimension of some function.

◆ LoopLevel() [3/3]

Halide::LoopLevel::LoopLevel ( )
default

Construct an undefined LoopLevel.

Calling any method on an undefined LoopLevel (other than defined() or operator==) will assert.

Member Function Documentation

◆ defined()

EXPORT bool Halide::LoopLevel::defined ( ) const

Return true iff the LoopLevel is defined.

◆ func()

EXPORT std::string Halide::LoopLevel::func ( ) const

Return the Func name.

Asserts if the LoopLevel is_root() or is_inline().

◆ var()

EXPORT VarOrRVar Halide::LoopLevel::var ( ) const

Return the VarOrRVar.

Asserts if the LoopLevel is_root() or is_inline().

◆ inlined()

static EXPORT LoopLevel Halide::LoopLevel::inlined ( )
static

inlined is a special LoopLevel value that implies that a function should be inlined away.

Referenced by Halide::Convert< FROM, TO >::value().

◆ is_inline()

EXPORT bool Halide::LoopLevel::is_inline ( ) const

Test if a loop level corresponds to inlining the function.

◆ root()

static EXPORT LoopLevel Halide::LoopLevel::root ( )
static

root is a special LoopLevel value which represents the location outside of all for loops

Referenced by Halide::Convert< FROM, TO >::value().

◆ is_root()

EXPORT bool Halide::LoopLevel::is_root ( ) const

Test if a loop level is 'root', which describes the site outside of all for loops.

◆ to_string()

EXPORT std::string Halide::LoopLevel::to_string ( ) const

Return a string of the form func.var – note that this is safe to call for root or inline LoopLevels.

◆ match() [1/2]

EXPORT bool Halide::LoopLevel::match ( const std::string &  loop) const

Compare this loop level against the variable name of a for loop, to see if this loop level refers to the site immediately inside this loop.

◆ match() [2/2]

EXPORT bool Halide::LoopLevel::match ( const LoopLevel other) const

◆ operator==()

EXPORT bool Halide::LoopLevel::operator== ( const LoopLevel other) const

Check if two loop levels are exactly the same.

◆ operator!=()

bool Halide::LoopLevel::operator!= ( const LoopLevel other) const
inline

Definition at line 161 of file Schedule.h.


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