Struct mnn::ffi::halide_buffer_t

source ·
#[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

source§

fn clone(&self) -> halide_buffer_t

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for halide_buffer_t

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Copy for halide_buffer_t

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.