Halide 14.0.0
Halide compiler and libraries
Halide::Buffer< T, Dims > 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

virtual ~Buffer ()=default
 
 Buffer ()=default
 Make a null Buffer, which points to no Runtime::Buffer. More...
 
 Buffer (const Buffer &that)=default
 Trivial copy constructor. More...
 
Bufferoperator= (const Buffer &that)=default
 Trivial copy assignment operator. More...
 
Bufferoperator= (Buffer &&) noexcept=default
 Trivial move assignment operator. More...
 
template<typename T2 , int D2>
 Buffer (const Buffer< T2, D2 > &other)
 Make a Buffer from a Buffer of a different type. More...
 
template<typename T2 , int D2>
 Buffer (Buffer< T2, D2 > &&other) noexcept
 Move construct from a Buffer of a different type. More...
 
template<int D2>
 Buffer (Runtime::Buffer< T, D2 > &&buf, const std::string &name="")
 Construct a Buffer that captures and owns an rvalue Runtime::Buffer. 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="")
 
template<typename... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
 Buffer (int first, Args... rest)
 
 Buffer (Type t, const std::vector< int > &sizes, const std::string &name="")
 
 Buffer (Type t, const std::vector< int > &sizes, const std::vector< int > &storage_order, const std::string &name="")
 
 Buffer (const std::vector< int > &sizes, const std::string &name="")
 
 Buffer (const std::vector< int > &sizes, const std::vector< int > &storage_order, const std::string &name="")
 
template<typename Array , size_t N>
 Buffer (Array(&vals)[N], const std::string &name="")
 
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)
 
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, const std::vector< int > &sizes, const std::string &name="")
 
template<typename... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
 Buffer (T *data, int first, Args &&...rest)
 
 Buffer (T *data, const std::vector< int > &sizes, const std::string &name="")
 
 Buffer (Type t, Internal::add_const_if_T_is_const< T, void > *data, const std::vector< int > &sizes, const std::string &name="")
 
 Buffer (Type t, Internal::add_const_if_T_is_const< T, void > *data, int d, const halide_dimension_t *shape, const std::string &name="")
 
 Buffer (T *data, int d, const halide_dimension_t *shape, const std::string &name="")
 
void set_name (const std::string &n)
 Buffers are optionally named. More...
 
const std::string & name () const
 
template<typename T2 , int D2>
bool same_as (const Buffer< T2, D2 > &other) const
 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...
 
Runtime::Buffer< T, Dims > * get ()
 Get a pointer to the underlying Runtime::Buffer. More...
 
const Runtime::Buffer< T, Dims > * get () const
 
template<typename Fn , typename... Args>
Buffer< T, Dims > & for_each_value (Fn &&f, Args... other_buffers)
 Does the same thing as the equivalent Halide::Runtime::Buffer method. More...
 
template<typename Fn , typename... Args>
const Buffer< T, Dims > & for_each_value (Fn &&f, Args... other_buffers) const
 
template<typename Fn >
Buffer< T, Dims > & for_each_element (Fn &&f)
 
template<typename Fn >
const Buffer< T, Dims > & for_each_element (Fn &&f) const
 
template<typename FnOrValue >
Buffer< T, Dims > & fill (FnOrValue &&f)
 
Type type () const
 
template<typename T2 , int D2 = Dims>
Buffer< T2, D2 > as () const
 
Buffer< T, Dims > copy () const
 
template<typename T2 , int D2>
void copy_from (const Buffer< T2, D2 > &other)
 
template<typename... Args>
auto operator() (int first, Args &&...args) -> decltype(std::declval< Runtime::Buffer< T, Dims > >()(first, std::forward< Args >(args)...))
 
template<typename... Args>
auto operator() (int first, Args &&...args) const -> decltype(std::declval< const Runtime::Buffer< T, Dims > >()(first, std::forward< Args >(args)...))
 
auto operator() (const int *pos) -> decltype(std::declval< Runtime::Buffer< T, Dims > >()(pos))
 
auto operator() (const int *pos) const -> decltype(std::declval< const Runtime::Buffer< T, Dims > >()(pos))
 
auto operator() () -> decltype(std::declval< Runtime::Buffer< T, Dims > >()())
 
auto operator() () const -> decltype(std::declval< const Runtime::Buffer< T, Dims > >()())
 
template<typename... Args>
Expr operator() (const 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
 
int copy_to_device (const Target &t=get_jit_target_from_environment(), JITUserContext *context=nullptr)
 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(), JITUserContext *context=nullptr)
 Copy to the GPU, using the given device API. More...
 
int device_malloc (const Target &t=get_jit_target_from_environment(), JITUserContext *context=nullptr)
 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(), JITUserContext *context=nullptr)
 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(), JITUserContext *context=nullptr)
 Wrap a native handle, using the given device API. More...
 

Static Public Member Functions

static Buffer< T, Dims > make_scalar (const std::string &name="")
 
static Buffer make_scalar (Type t, const std::string &name="")
 
static Buffer< T, Dims > make_scalar (T *data, const std::string &name="")
 
static Buffer< T, Dims > make_interleaved (int width, int height, int channels, const std::string &name="")
 
static Buffer make_interleaved (Type t, int width, int height, int channels, const std::string &name="")
 
static Buffer< T, Dims > make_interleaved (T *data, int width, int height, int channels, const std::string &name="")
 
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="")
 
template<typename T2 , int D2>
static Buffer< T, Dims > make_with_shape_of (Buffer< T2, D2 > src, void *(*allocate_fn)(size_t)=nullptr, void(*deallocate_fn)(void *)=nullptr, const std::string &name="")
 
template<typename T2 , int D2>
static Buffer< T, Dims > make_with_shape_of (const Runtime::Buffer< T2, D2 > &src, void *(*allocate_fn)(size_t)=nullptr, void(*deallocate_fn)(void *)=nullptr, const std::string &name="")
 
static constexpr halide_type_t static_halide_type ()
 
static constexpr int static_dimensions ()
 
template<typename T2 , int D2>
static bool can_convert_from (const Buffer< T2, D2 > &other)
 

Static Public Attributes

static constexpr int AnyDims = Halide::Runtime::AnyDims
 
static constexpr bool has_static_halide_type = Runtime::Buffer<T, Dims>::has_static_halide_type
 
static constexpr bool has_static_dimensions = Runtime::Buffer<T, Dims>::has_static_dimensions
 

Detailed Description

template<typename T, int Dims>
class Halide::Buffer< T, Dims >

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

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

A Buffer<T, D1> can refer to a Buffer<T, D2> if D1 == D2, or if D1 is AnyDims (meaning "dimensionality is checked at runtime, not compiletime").

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 120 of file Buffer.h.

Member Typedef Documentation

◆ ElemType

template<typename T , int Dims>
typedef T Halide::Buffer< T, Dims >::ElemType

Definition at line 159 of file Buffer.h.

Constructor & Destructor Documentation

◆ ~Buffer()

template<typename T , int Dims>
virtual Halide::Buffer< T, Dims >::~Buffer ( )
virtualdefault

◆ Buffer() [1/20]

template<typename T , int Dims>
Halide::Buffer< T, Dims >::Buffer ( )
default

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

◆ Buffer() [2/20]

template<typename T , int Dims>
Halide::Buffer< T, Dims >::Buffer ( const Buffer< T, Dims > &  that)
default

Trivial copy constructor.

◆ Buffer() [3/20]

template<typename T , int Dims>
template<typename T2 , int D2>
Halide::Buffer< T, Dims >::Buffer ( const Buffer< T2, D2 > &  other)
inline

Make a Buffer from a Buffer of a different type.

Definition at line 179 of file Buffer.h.

◆ Buffer() [4/20]

template<typename T , int Dims>
template<typename T2 , int D2>
Halide::Buffer< T, Dims >::Buffer ( Buffer< T2, D2 > &&  other)
inlinenoexcept

Move construct from a Buffer of a different type.

Definition at line 186 of file Buffer.h.

◆ Buffer() [5/20]

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

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

Definition at line 193 of file Buffer.h.

◆ Buffer() [6/20]

template<typename T , int Dims>
template<typename... Args, typename = typename std::enable_if<Internal::all_ints_and_optional_name<Args...>::value>::type>
Halide::Buffer< T, Dims >::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 210 of file Buffer.h.

References Halide::Internal.

◆ Buffer() [7/20]

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

Definition at line 216 of file Buffer.h.

◆ Buffer() [8/20]

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

Definition at line 223 of file Buffer.h.

References Halide::Internal.

◆ Buffer() [9/20]

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

Definition at line 228 of file Buffer.h.

◆ Buffer() [10/20]

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

Definition at line 234 of file Buffer.h.

◆ Buffer() [11/20]

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

Definition at line 241 of file Buffer.h.

◆ Buffer() [12/20]

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

Definition at line 246 of file Buffer.h.

◆ Buffer() [13/20]

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

Definition at line 253 of file Buffer.h.

◆ Buffer() [14/20]

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

Definition at line 260 of file Buffer.h.

References Halide::Internal.

◆ Buffer() [15/20]

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

Definition at line 269 of file Buffer.h.

◆ Buffer() [16/20]

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

Definition at line 278 of file Buffer.h.

References Halide::Internal.

◆ Buffer() [17/20]

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

Definition at line 284 of file Buffer.h.

◆ Buffer() [18/20]

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

Definition at line 290 of file Buffer.h.

◆ Buffer() [19/20]

template<typename T , int Dims>
Halide::Buffer< T, Dims >::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

Definition at line 297 of file Buffer.h.

◆ Buffer() [20/20]

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

Definition at line 305 of file Buffer.h.

Member Function Documentation

◆ operator=() [1/2]

template<typename T , int Dims>
Buffer & Halide::Buffer< T, Dims >::operator= ( const Buffer< T, Dims > &  that)
default

Trivial copy assignment operator.

◆ operator=() [2/2]

template<typename T , int Dims>
Buffer & Halide::Buffer< T, Dims >::operator= ( Buffer< T, Dims > &&  )
defaultnoexcept

Trivial move assignment operator.

◆ make_scalar() [1/3]

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

Definition at line 312 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_scalar() [2/3]

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

Definition at line 316 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_scalar() [3/3]

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

Definition at line 320 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_interleaved() [1/4]

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

Definition at line 324 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_interleaved() [2/4]

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

Definition at line 328 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_interleaved() [3/4]

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

Definition at line 332 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_interleaved() [4/4]

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

Definition at line 337 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ make_with_shape_of() [1/2]

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

◆ make_with_shape_of() [2/2]

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

Definition at line 351 of file Buffer.h.

References Halide::Buffer< T, Dims >::name().

◆ set_name()

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

Buffers are optionally named.

Definition at line 361 of file Buffer.h.

◆ name()

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

◆ same_as()

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

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

Definition at line 372 of file Buffer.h.

References Halide::Internal::IntrusivePtr< T >::get().

◆ defined()

template<typename T , int Dims>
bool Halide::Buffer< T, Dims >::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 379 of file Buffer.h.

References Halide::Internal::IntrusivePtr< T >::defined().

◆ get() [1/2]

◆ get() [2/2]

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

Definition at line 389 of file Buffer.h.

◆ for_each_value() [1/2]

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

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

Definition at line 481 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ for_each_value() [2/2]

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

Definition at line 487 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ for_each_element() [1/2]

template<typename T , int Dims>
template<typename Fn >
Buffer< T, Dims > & Halide::Buffer< T, Dims >::for_each_element ( Fn &&  f)
inline

Definition at line 493 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ for_each_element() [2/2]

template<typename T , int Dims>
template<typename Fn >
const Buffer< T, Dims > & Halide::Buffer< T, Dims >::for_each_element ( Fn &&  f) const
inline

Definition at line 499 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ fill()

template<typename T , int Dims>
template<typename FnOrValue >
Buffer< T, Dims > & Halide::Buffer< T, Dims >::fill ( FnOrValue &&  f)
inline

Definition at line 505 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ static_halide_type()

template<typename T , int Dims>
static constexpr halide_type_t Halide::Buffer< T, Dims >::static_halide_type ( )
inlinestaticconstexpr

◆ static_dimensions()

template<typename T , int Dims>
static constexpr int Halide::Buffer< T, Dims >::static_dimensions ( )
inlinestaticconstexpr

◆ can_convert_from()

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

◆ type()

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

◆ as()

template<typename T , int Dims>
template<typename T2 , int D2 = Dims>
Buffer< T2, D2 > Halide::Buffer< T, Dims >::as ( ) const
inline

Definition at line 536 of file Buffer.h.

Referenced by Halide::Realization::operator Buffer< T, Dims >().

◆ copy()

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

Definition at line 540 of file Buffer.h.

◆ copy_from()

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

Definition at line 545 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [1/8]

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

Definition at line 550 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [2/8]

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

Definition at line 555 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [3/8]

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

Definition at line 559 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [4/8]

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

Definition at line 563 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [5/8]

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

Definition at line 567 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [6/8]

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

Definition at line 571 of file Buffer.h.

References Halide::Buffer< T, Dims >::get().

◆ operator()() [7/8]

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

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

Definition at line 579 of file Buffer.h.

◆ operator()() [8/8]

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

Definition at line 585 of file Buffer.h.

References Halide::Internal::buffer_accessor().

◆ copy_to_device() [1/2]

template<typename T , int Dims>
int Halide::Buffer< T, Dims >::copy_to_device ( const Target t = get_jit_target_from_environment(),
JITUserContext context = nullptr 
)
inline

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

Definition at line 591 of file Buffer.h.

References Halide::Buffer< T, Dims >::copy_to_device(), and Halide::Default_GPU.

Referenced by Halide::Buffer< T, Dims >::copy_to_device().

◆ copy_to_device() [2/2]

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

Copy to the GPU, using the given device API.

Definition at line 596 of file Buffer.h.

References Halide::get_device_interface_for_device_api().

◆ device_malloc() [1/2]

template<typename T , int Dims>
int Halide::Buffer< T, Dims >::device_malloc ( const Target t = get_jit_target_from_environment(),
JITUserContext context = nullptr 
)
inline

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

Definition at line 601 of file Buffer.h.

References Halide::Default_GPU, and Halide::Buffer< T, Dims >::device_malloc().

Referenced by Halide::Buffer< T, Dims >::device_malloc().

◆ device_malloc() [2/2]

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

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

Definition at line 606 of file Buffer.h.

References Halide::get_device_interface_for_device_api().

◆ device_wrap_native()

template<typename T , int Dims>
int Halide::Buffer< T, Dims >::device_wrap_native ( const DeviceAPI d,
uint64_t  handle,
const Target t = get_jit_target_from_environment(),
JITUserContext context = nullptr 
)
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 615 of file Buffer.h.

References Halide::get_device_interface_for_device_api().

Member Data Documentation

◆ AnyDims

template<typename T , int Dims>
constexpr int Halide::Buffer< T, Dims >::AnyDims = Halide::Runtime::AnyDims
staticconstexpr

Definition at line 156 of file Buffer.h.

◆ has_static_halide_type

template<typename T , int Dims>
constexpr bool Halide::Buffer< T, Dims >::has_static_halide_type = Runtime::Buffer<T, Dims>::has_static_halide_type
staticconstexpr

Definition at line 510 of file Buffer.h.

◆ has_static_dimensions

template<typename T , int Dims>
constexpr bool Halide::Buffer< T, Dims >::has_static_dimensions = Runtime::Buffer<T, Dims>::has_static_dimensions
staticconstexpr

Definition at line 516 of file Buffer.h.


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