Halide
Halide::Tuple Class Reference

Create a small array of Exprs for defining and calling functions with multiple outputs. More...

#include <Tuple.h>

Public Member Functions

size_t size () const
 The number of elements in the tuple. More...
 
Exproperator[] (size_t x)
 Get a reference to an element. More...
 
Expr operator[] (size_t x) const
 Get a copy of an element. More...
 
 Tuple (Expr e)
 Construct a Tuple of a single Expr. More...
 
NO_INLINE Tuple (const std::vector< Expr > &e)
 Construct a Tuple from a vector of Exprs. More...
 
EXPORT Tuple (const FuncRef &)
 Construct a Tuple from a function reference. More...
 
const std::vector< Expr > & as_vector () const
 Treat the tuple as a vector of Exprs. More...
 
template<typename ... Args>
 Tuple (Expr a, Expr b, Args &&... args)
 Construct a Tuple from some Exprs. More...
 

Detailed Description

Create a small array of Exprs for defining and calling functions with multiple outputs.

Examples:
tutorial/lesson_13_tuples.cpp.

Definition at line 19 of file Tuple.h.

Constructor & Destructor Documentation

◆ Tuple() [1/4]

Halide::Tuple::Tuple ( Expr  e)
inlineexplicit

Construct a Tuple of a single Expr.

Definition at line 39 of file Tuple.h.

Referenced by Tuple().

◆ Tuple() [2/4]

template<typename ... Args>
Halide::Tuple::Tuple ( Expr  a,
Expr  b,
Args &&...  args 
)
inline

Construct a Tuple from some Exprs.

Definition at line 46 of file Tuple.h.

References Halide::Runtime::Internal::a, and Halide::Runtime::Internal::b.

◆ Tuple() [3/4]

NO_INLINE Halide::Tuple::Tuple ( const std::vector< Expr > &  e)
inlineexplicit

Construct a Tuple from a vector of Exprs.

Definition at line 52 of file Tuple.h.

References EXPORT, Tuple(), and user_assert.

◆ Tuple() [4/4]

EXPORT Halide::Tuple::Tuple ( const FuncRef )

Construct a Tuple from a function reference.

Member Function Documentation

◆ size()

size_t Halide::Tuple::size ( ) const
inline

The number of elements in the tuple.

Definition at line 24 of file Tuple.h.

Referenced by Halide::tuple_select().

◆ operator[]() [1/2]

Expr& Halide::Tuple::operator[] ( size_t  x)
inline

Get a reference to an element.

Definition at line 27 of file Tuple.h.

References user_assert.

◆ operator[]() [2/2]

Expr Halide::Tuple::operator[] ( size_t  x) const
inline

Get a copy of an element.

Definition at line 33 of file Tuple.h.

References user_assert.

◆ as_vector()

const std::vector<Expr>& Halide::Tuple::as_vector ( ) const
inline

Treat the tuple as a vector of Exprs.

Definition at line 60 of file Tuple.h.


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