Halide
Halide::Realization Class Reference

A Realization is a vector of references to existing Buffer objects. More...

#include <Realization.h>

Public Member Functions

size_t size () const
 The number of images in the Realization. More...
 
const Buffer< void > & operator[] (size_t x) const
 Get a const reference to one of the images. More...
 
Buffer< void > & operator[] (size_t x)
 Get a reference to one of the images. More...
 
template<typename T , int Dims>
 operator Buffer< T, Dims > () const
 Single-element realizations are implicitly castable to Buffers. More...
 
 Realization (const Buffer< void > &e)
 Construct a Realization that acts as a reference to a single existing Buffer. More...
 
 Realization (Buffer< void > &&e)
 
 Realization (const std::vector< Buffer< void >> &e)
 Construct a Realization that refers to the buffers in an existing vector of Buffer<>. More...
 
 Realization (std::vector< Buffer< void >> &&e)
 
 Realization (std::initializer_list< Buffer< void >> e)
 
int device_sync (void *ctx=nullptr)
 Call device_sync() for all Buffers in the Realization. More...
 

Detailed Description

A Realization is a vector of references to existing Buffer objects.

A pipeline with multiple outputs realize to a Realization.

Examples
tutorial/lesson_13_tuples.cpp.

Definition at line 19 of file Realization.h.

Constructor & Destructor Documentation

◆ Realization() [1/5]

Halide::Realization::Realization ( const Buffer< void > &  e)
explicit

Construct a Realization that acts as a reference to a single existing Buffer.

The element type of the Buffer may not be const.

◆ Realization() [2/5]

Halide::Realization::Realization ( Buffer< void > &&  e)
explicit

◆ Realization() [3/5]

Halide::Realization::Realization ( const std::vector< Buffer< void >> &  e)
explicit

Construct a Realization that refers to the buffers in an existing vector of Buffer<>.

The element type of the Buffer(s) may not be const

◆ Realization() [4/5]

Halide::Realization::Realization ( std::vector< Buffer< void >> &&  e)
explicit

◆ Realization() [5/5]

Halide::Realization::Realization ( std::initializer_list< Buffer< void >>  e)
inlineexplicit

Definition at line 57 of file Realization.h.

Member Function Documentation

◆ size()

size_t Halide::Realization::size ( ) const

The number of images in the Realization.

Examples
tutorial/lesson_13_tuples.cpp.

Referenced by Halide::Pipeline::RealizationArg::size().

◆ operator[]() [1/2]

const Buffer<void>& Halide::Realization::operator[] ( size_t  x) const

Get a const reference to one of the images.

◆ operator[]() [2/2]

Buffer<void>& Halide::Realization::operator[] ( size_t  x)

Get a reference to one of the images.

◆ operator Buffer< T, Dims >()

template<typename T , int Dims>
Halide::Realization::operator Buffer< T, Dims > ( ) const
inline

Single-element realizations are implicitly castable to Buffers.

Definition at line 35 of file Realization.h.

References user_assert.

◆ device_sync()

int Halide::Realization::device_sync ( void *  ctx = nullptr)

Call device_sync() for all Buffers in the Realization.

If one of the calls returns an error, subsequent Buffers won't have device_sync called; thus callers should consider a nonzero return code to mean that potentially all of the Buffers are in an indeterminate state of sync. Calling this explicitly should rarely be necessary, except for profiling.


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