#[repr(C)]pub struct halide_buffer_t {
pub device: u64,
pub device_interface: *const halide_device_interface_t,
pub host: *mut u8,
pub flags: u64,
pub type_: halide_type_t,
pub dimensions: i32,
pub dim: *mut halide_dimension_t,
pub padding: *mut c_void,
}
Expand description
\file
This file declares the routines used by Halide internally in its runtime. On platforms that support weak linking, these can be replaced with user-defined versions by defining an extern “C” function with the same name and signature.
When doing Just In Time (JIT) compilation methods on the Func being compiled must be called instead. The corresponding methods are documented below.
All of these functions take a “void *user_context” parameter as their first argument; if the Halide kernel that calls back to any of these functions has been compiled with the UserContext feature set on its Target, then the value of that pointer passed from the code that calls the Halide kernel is piped through to the function.
Some of these are also useful to call when using the default implementation. E.g. halide_shutdown_thread_pool.
Note that even on platforms with weak linking, some linker setups may not respect the override you provide. E.g. if the override is in a shared library and the halide object files are linked directly into the output, the builtin versions of the runtime functions will be called. See your linker documentation for more details. On Linux, LD_DYNAMIC_WEAK=1 may help.
Fields§
§device: u64
A device-handle for e.g. GPU memory used to back this buffer.
device_interface: *const halide_device_interface_t
The interface used to interpret the above handle.
host: *mut u8
A pointer to the start of the data in main memory. In terms of the Halide coordinate system, this is the address of the min coordinates (defined below).
flags: u64
flags with various meanings.
type_: halide_type_t
The type of each buffer element.
dimensions: i32
The dimensionality of the buffer.
dim: *mut halide_dimension_t
The shape of the buffer. Halide does not own this array - you must manage the memory for it yourself.
padding: *mut c_void
Pads the buffer up to a multiple of 8 bytes
Trait Implementations§
source§impl Clone for halide_buffer_t
impl Clone for halide_buffer_t
source§fn clone(&self) -> halide_buffer_t
fn clone(&self) -> halide_buffer_t
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for halide_buffer_t
impl Debug for halide_buffer_t
impl Copy for halide_buffer_t
Auto Trait Implementations§
impl Freeze for halide_buffer_t
impl RefUnwindSafe for halide_buffer_t
impl !Send for halide_buffer_t
impl !Sync for halide_buffer_t
impl Unpin for halide_buffer_t
impl UnwindSafe for halide_buffer_t
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)