Halide
Halide::Buffer< T > Class Template Reference

A Halide::Buffer is a named shared reference to a Halide::Runtime::Buffer. More...

#include <Buffer.h>

Public Types

typedef T ElemType
 

Public Member Functions

 Buffer ()
 Make a null Buffer, which points to no Runtime::Buffer. More...
 
template<typename T2 >
 Buffer (const Buffer< T2 > &other)
 Make a Buffer from a Buffer of a different type. More...
 
template<typename T2 >
 Buffer (Buffer< T2 > &&other)
 Move construct from a Buffer of a different type. More...
 
template<int D>
 Buffer (Runtime::Buffer< T, D > &&buf, const std::string &name="")
 Construct a Buffer that captures and owns an rvalue Runtime::Buffer. More...
 
template<typename T2 >
bool same_as (const Buffer< T2 > &other)
 Check if two Buffer objects point to the same underlying Buffer. More...
 
bool defined () const
 Check if this Buffer refers to an existing Buffer. More...
 
int copy_to_device (const Target &t=get_jit_target_from_environment())
 Copy to the GPU, using the device API that is the default for the given Target. More...
 
int copy_to_device (const DeviceAPI &d, const Target &t=get_jit_target_from_environment())
 Copy to the GPU, using the given device API. More...
 
int device_malloc (const Target &t=get_jit_target_from_environment())
 Allocate on the GPU, using the device API that is the default for the given Target. More...
 
int device_malloc (const DeviceAPI &d, const Target &t=get_jit_target_from_environment())
 Allocate storage on the GPU, using the given device API. More...
 
int device_wrap_native (const DeviceAPI &d, uint64_t handle, const Target &t=get_jit_target_from_environment())
 Wrap a native handle, using the given device API. More...
 
void set_name (const std::string &n)
 Buffers are optionally named. More...
 
const std::string & name () const
 Buffers are optionally named. More...
 
Runtime::Buffer< T > * get ()
 Get a pointer to the underlying Runtime::Buffer. More...
 
const Runtime::Buffer< T > * get () const
 Get a pointer to the underlying Runtime::Buffer. More...
 
template<typename ... Args>
Expr operator() (Expr first, Args... rest) const
 Make an Expr that loads from this concrete buffer at a computed coordinate. More...
 
template<typename ... Args>
Expr operator() (const std::vector< Expr > &args) const
 Make an Expr that loads from this concrete buffer at a computed coordinate. More...
 
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
 Buffer (Type t, int first, Args... rest)
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (const halide_buffer_t &buf, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (const buffer_t &buf, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
 Buffer (int first, Args... rest)
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (Type t, const std::vector< int > &sizes, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (const std::vector< int > &sizes, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
template<typename Array , size_t N>
 Buffer (Array(&vals)[N], const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
 Buffer (Type t, Internal::add_const_if_T_is_const< T, void > *data, int first, Args &&... rest)
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
 Buffer (T *data, int first, Args &&... rest)
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (T *data, const std::vector< int > &sizes, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (Type t, Internal::add_const_if_T_is_const< T, void > *data, const std::vector< int > &sizes, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (Type t, Internal::add_const_if_T_is_const< T, void > *data, int d, const halide_dimension_t *shape, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
 Buffer (T *data, int d, const halide_dimension_t *shape, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static Buffer< T > make_scalar (const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static Buffer make_scalar (Type t, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static Buffer< T > make_interleaved (int width, int height, int channels, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static Buffer make_interleaved (Type t, int width, int height, int channels, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static Buffer< T > make_interleaved (T *data, int width, int height, int channels, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static Buffer< Internal::add_const_if_T_is_const< T, void > > make_interleaved (Type t, T *data, int width, int height, int channels, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
template<typename T2 >
static Buffer< T > make_with_shape_of (Buffer< T2 > src, void *(*allocate_fn)(size_t)=nullptr, void(*deallocate_fn)(void *)=nullptr, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
template<typename T2 >
static Buffer< T > make_with_shape_of (const Runtime::Buffer< T2 > &src, void *(*allocate_fn)(size_t)=nullptr, void(*deallocate_fn)(void *)=nullptr, const std::string &name="")
 Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name. More...
 
static constexpr bool has_static_halide_type = Runtime::Buffer<T>::has_static_halide_type
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename Fn , typename ... Args>
void for_each_value (Fn &&f, Args... other_buffers)
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
Type type () const
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename T2 >
Buffer< T2 > as () const
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
Buffer< T > copy () const
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename T2 >
void copy_from (const Buffer< T2 > &other)
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename ... Args>
auto operator() (int first, Args &&... args) -> decltype(std::declval< Runtime::Buffer< T >>()(first, std::forward< Args >(args)...))
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename ... Args>
auto operator() (int first, Args &&... args) const -> decltype(std::declval< const Runtime::Buffer< T >>()(first, std::forward< Args >(args)...))
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
auto operator() (const int *pos) -> decltype(std::declval< Runtime::Buffer< T >>()(pos))
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
auto operator() (const int *pos) const -> decltype(std::declval< const Runtime::Buffer< T >>()(pos))
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
auto operator() () -> decltype(std::declval< Runtime::Buffer< T >>()())
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
auto operator() () const -> decltype(std::declval< const Runtime::Buffer< T >>()())
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
static halide_type_t static_halide_type ()
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename T2 >
static bool can_convert_from (const Buffer< T2 > &other)
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 

Detailed Description

template<typename T>
class Halide::Buffer< T >

A Halide::Buffer is a named shared reference to a Halide::Runtime::Buffer.

A Buffer<T1> can refer to a Buffer<T2> if T1 is const whenever T2 is const, and either T1 = T2 or T1 is void. A Buffer<void> can refer to any Buffer of any non-const type, and the default template parameter is T = void.

Examples:
tutorial/lesson_01_basics.cpp, tutorial/lesson_02_input_image.cpp, tutorial/lesson_03_debugging_1.cpp, tutorial/lesson_04_debugging_2.cpp, tutorial/lesson_05_scheduling_1.cpp, tutorial/lesson_06_realizing_over_shifted_domains.cpp, tutorial/lesson_07_multi_stage_pipelines.cpp, tutorial/lesson_08_scheduling_2.cpp, tutorial/lesson_09_update_definitions.cpp, tutorial/lesson_12_using_the_gpu.cpp, and tutorial/lesson_13_tuples.cpp.

Definition at line 12 of file Buffer.h.

Member Typedef Documentation

◆ ElemType

template<typename T>
typedef T Halide::Buffer< T >::ElemType

Definition at line 105 of file Buffer.h.

Constructor & Destructor Documentation

◆ Buffer() [1/17]

template<typename T>
Halide::Buffer< T >::Buffer ( )
inline

Make a null Buffer, which points to no Runtime::Buffer.

Definition at line 108 of file Buffer.h.

◆ Buffer() [2/17]

template<typename T>
template<typename T2 >
Halide::Buffer< T >::Buffer ( const Buffer< T2 > &  other)
inline

Make a Buffer from a Buffer of a different type.

Definition at line 112 of file Buffer.h.

◆ Buffer() [3/17]

template<typename T>
template<typename T2 >
Halide::Buffer< T >::Buffer ( Buffer< T2 > &&  other)
inline

Move construct from a Buffer of a different type.

Definition at line 119 of file Buffer.h.

◆ Buffer() [4/17]

template<typename T>
template<int D>
Halide::Buffer< T >::Buffer ( Runtime::Buffer< T, D > &&  buf,
const std::string &  name = "" 
)
inline

Construct a Buffer that captures and owns an rvalue Runtime::Buffer.

Definition at line 126 of file Buffer.h.

◆ Buffer() [5/17]

template<typename T>
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
Halide::Buffer< T >::Buffer ( Type  t,
int  first,
Args...  rest 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 143 of file Buffer.h.

◆ Buffer() [6/17]

template<typename T>
Halide::Buffer< T >::Buffer ( const halide_buffer_t buf,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 148 of file Buffer.h.

◆ Buffer() [7/17]

template<typename T>
Halide::Buffer< T >::Buffer ( const buffer_t buf,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 152 of file Buffer.h.

◆ Buffer() [8/17]

template<typename T>
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
Halide::Buffer< T >::Buffer ( int  first,
Args...  rest 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 158 of file Buffer.h.

◆ Buffer() [9/17]

template<typename T>
Halide::Buffer< T >::Buffer ( Type  t,
const std::vector< int > &  sizes,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 162 of file Buffer.h.

◆ Buffer() [10/17]

template<typename T>
Halide::Buffer< T >::Buffer ( const std::vector< int > &  sizes,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 167 of file Buffer.h.

◆ Buffer() [11/17]

template<typename T>
template<typename Array , size_t N>
Halide::Buffer< T >::Buffer ( Array(&)  vals[N],
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 172 of file Buffer.h.

◆ Buffer() [12/17]

template<typename T>
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
Halide::Buffer< T >::Buffer ( Type  t,
Internal::add_const_if_T_is_const< T, void > *  data,
int  first,
Args &&...  rest 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 178 of file Buffer.h.

◆ Buffer() [13/17]

template<typename T>
template<typename ... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
Halide::Buffer< T >::Buffer ( T *  data,
int  first,
Args &&...  rest 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 186 of file Buffer.h.

◆ Buffer() [14/17]

template<typename T>
Halide::Buffer< T >::Buffer ( T *  data,
const std::vector< int > &  sizes,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 191 of file Buffer.h.

◆ Buffer() [15/17]

template<typename T>
Halide::Buffer< T >::Buffer ( Type  t,
Internal::add_const_if_T_is_const< T, void > *  data,
const std::vector< int > &  sizes,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 196 of file Buffer.h.

◆ Buffer() [16/17]

template<typename T>
Halide::Buffer< T >::Buffer ( Type  t,
Internal::add_const_if_T_is_const< T, void > *  data,
int  d,
const halide_dimension_t shape,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 202 of file Buffer.h.

◆ Buffer() [17/17]

template<typename T>
Halide::Buffer< T >::Buffer ( T *  data,
int  d,
const halide_dimension_t shape,
const std::string &  name = "" 
)
inlineexplicit

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 209 of file Buffer.h.

Member Function Documentation

◆ make_scalar() [1/2]

template<typename T>
static Buffer<T> Halide::Buffer< T >::make_scalar ( const std::string &  name = "")
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 216 of file Buffer.h.

◆ make_scalar() [2/2]

template<typename T>
static Buffer Halide::Buffer< T >::make_scalar ( Type  t,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 220 of file Buffer.h.

◆ make_interleaved() [1/4]

template<typename T>
static Buffer<T> Halide::Buffer< T >::make_interleaved ( int  width,
int  height,
int  channels,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 224 of file Buffer.h.

◆ make_interleaved() [2/4]

template<typename T>
static Buffer Halide::Buffer< T >::make_interleaved ( Type  t,
int  width,
int  height,
int  channels,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 229 of file Buffer.h.

◆ make_interleaved() [3/4]

template<typename T>
static Buffer<T> Halide::Buffer< T >::make_interleaved ( T *  data,
int  width,
int  height,
int  channels,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 234 of file Buffer.h.

◆ make_interleaved() [4/4]

template<typename T>
static Buffer<Internal::add_const_if_T_is_const<T, void> > Halide::Buffer< T >::make_interleaved ( Type  t,
T *  data,
int  width,
int  height,
int  channels,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 240 of file Buffer.h.

◆ make_with_shape_of() [1/2]

template<typename T>
template<typename T2 >
static Buffer<T> Halide::Buffer< T >::make_with_shape_of ( Buffer< T2 >  src,
void *(*)(size_t allocate_fn = nullptr,
void(*)(void *)  deallocate_fn = nullptr,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 247 of file Buffer.h.

◆ make_with_shape_of() [2/2]

template<typename T>
template<typename T2 >
static Buffer<T> Halide::Buffer< T >::make_with_shape_of ( const Runtime::Buffer< T2 > &  src,
void *(*)(size_t allocate_fn = nullptr,
void(*)(void *)  deallocate_fn = nullptr,
const std::string &  name = "" 
)
inlinestatic

Constructors that match Runtime::Buffer with two differences: 1) They take a Type instead of a halide_type_t 2) There is an optional last string argument that gives the buffer a specific name.

Definition at line 256 of file Buffer.h.

◆ set_name()

template<typename T>
void Halide::Buffer< T >::set_name ( const std::string &  n)
inline

Buffers are optionally named.

Definition at line 267 of file Buffer.h.

◆ name()

template<typename T>
const std::string& Halide::Buffer< T >::name ( ) const
inline

Buffers are optionally named.

Definition at line 271 of file Buffer.h.

Referenced by Halide::Internal::Call::make().

◆ same_as()

template<typename T>
template<typename T2 >
bool Halide::Buffer< T >::same_as ( const Buffer< T2 > &  other)
inline

Check if two Buffer objects point to the same underlying Buffer.

Definition at line 278 of file Buffer.h.

◆ defined()

template<typename T>
bool Halide::Buffer< T >::defined ( ) const
inline

Check if this Buffer refers to an existing Buffer.

Default-constructed Buffer objects do not refer to any existing Buffer.

Definition at line 285 of file Buffer.h.

◆ get() [1/2]

template<typename T>
Runtime::Buffer<T>* Halide::Buffer< T >::get ( )
inline

Get a pointer to the underlying Runtime::Buffer.

Definition at line 291 of file Buffer.h.

Referenced by Halide::Buffer<>::can_convert_from(), Halide::Buffer<>::copy_from(), and Halide::Buffer<>::make_with_shape_of().

◆ get() [2/2]

template<typename T>
const Runtime::Buffer<T>* Halide::Buffer< T >::get ( ) const
inline

Get a pointer to the underlying Runtime::Buffer.

Definition at line 295 of file Buffer.h.

◆ for_each_value()

template<typename T>
template<typename Fn , typename ... Args>
void Halide::Buffer< T >::for_each_value ( Fn &&  f,
Args...  other_buffers 
)
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 373 of file Buffer.h.

◆ static_halide_type()

template<typename T>
static halide_type_t Halide::Buffer< T >::static_halide_type ( )
inlinestatic

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 379 of file Buffer.h.

◆ can_convert_from()

template<typename T>
template<typename T2 >
static bool Halide::Buffer< T >::can_convert_from ( const Buffer< T2 > &  other)
inlinestatic

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 384 of file Buffer.h.

◆ type()

template<typename T>
Type Halide::Buffer< T >::type ( ) const
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 388 of file Buffer.h.

Referenced by Halide::Internal::Call::make(), and Halide::Internal::GeneratorOutput_Buffer< T >::operator=().

◆ as()

template<typename T>
template<typename T2 >
Buffer<T2> Halide::Buffer< T >::as ( ) const
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 393 of file Buffer.h.

◆ copy()

template<typename T>
Buffer<T> Halide::Buffer< T >::copy ( ) const
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 397 of file Buffer.h.

◆ copy_from()

template<typename T>
template<typename T2 >
void Halide::Buffer< T >::copy_from ( const Buffer< T2 > &  other)
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 402 of file Buffer.h.

◆ operator()() [1/8]

template<typename T>
template<typename ... Args>
auto Halide::Buffer< T >::operator() ( int  first,
Args &&...  args 
) -> decltype(std::declval<Runtime::Buffer<T>>()(first, std::forward<Args>(args)...))
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 407 of file Buffer.h.

◆ operator()() [2/8]

template<typename T>
template<typename ... Args>
auto Halide::Buffer< T >::operator() ( int  first,
Args &&...  args 
) const -> decltype(std::declval<const Runtime::Buffer<T>>()(first, std::forward<Args>(args)...))
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 413 of file Buffer.h.

◆ operator()() [3/8]

template<typename T>
auto Halide::Buffer< T >::operator() ( const int *  pos) -> decltype(std::declval<Runtime::Buffer<T>>()(pos))
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 418 of file Buffer.h.

◆ operator()() [4/8]

template<typename T>
auto Halide::Buffer< T >::operator() ( const int *  pos) const -> decltype(std::declval<const Runtime::Buffer<T>>()(pos))
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 423 of file Buffer.h.

◆ operator()() [5/8]

template<typename T>
auto Halide::Buffer< T >::operator() ( ) -> decltype(std::declval<Runtime::Buffer<T>>()())
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 428 of file Buffer.h.

◆ operator()() [6/8]

template<typename T>
auto Halide::Buffer< T >::operator() ( ) const -> decltype(std::declval<const Runtime::Buffer<T>>()())
inline

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 433 of file Buffer.h.

◆ operator()() [7/8]

template<typename T>
template<typename ... Args>
Expr Halide::Buffer< T >::operator() ( Expr  first,
Args...  rest 
) const
inline

Make an Expr that loads from this concrete buffer at a computed coordinate.

Definition at line 442 of file Buffer.h.

◆ operator()() [8/8]

template<typename T>
template<typename ... Args>
Expr Halide::Buffer< T >::operator() ( const std::vector< Expr > &  args) const
inline

Make an Expr that loads from this concrete buffer at a computed coordinate.

Definition at line 448 of file Buffer.h.

◆ copy_to_device() [1/2]

template<typename T>
int Halide::Buffer< T >::copy_to_device ( const Target t = get_jit_target_from_environment())
inline

Copy to the GPU, using the device API that is the default for the given Target.

Definition at line 455 of file Buffer.h.

◆ copy_to_device() [2/2]

template<typename T>
int Halide::Buffer< T >::copy_to_device ( const DeviceAPI d,
const Target t = get_jit_target_from_environment() 
)
inline

Copy to the GPU, using the given device API.

Definition at line 460 of file Buffer.h.

◆ device_malloc() [1/2]

template<typename T>
int Halide::Buffer< T >::device_malloc ( const Target t = get_jit_target_from_environment())
inline

Allocate on the GPU, using the device API that is the default for the given Target.

Definition at line 465 of file Buffer.h.

◆ device_malloc() [2/2]

template<typename T>
int Halide::Buffer< T >::device_malloc ( const DeviceAPI d,
const Target t = get_jit_target_from_environment() 
)
inline

Allocate storage on the GPU, using the given device API.

Definition at line 470 of file Buffer.h.

◆ device_wrap_native()

template<typename T>
int Halide::Buffer< T >::device_wrap_native ( const DeviceAPI d,
uint64_t  handle,
const Target t = get_jit_target_from_environment() 
)
inline

Wrap a native handle, using the given device API.

It is a bad idea to pass DeviceAPI::Default_GPU to this routine as the handle argument must match the API that the default resolves to and it is clearer and more reliable to pass the resolved DeviceAPI explicitly.

Definition at line 479 of file Buffer.h.

Member Data Documentation

◆ has_static_halide_type

template<typename T>
constexpr bool Halide::Buffer< T >::has_static_halide_type = Runtime::Buffer<T>::has_static_halide_type
static

Does the same thing as the equivalent Halide::Runtime::Buffer method.

Definition at line 377 of file Buffer.h.


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