pub struct ModelSlot { /* private fields */ }Expand description
An exclusively reserved slot. Dropping without submission releases capacity.
Implementations§
Source§impl ModelSlot
impl ModelSlot
Sourcepub fn submit_host(self, inputs: &[&[u8]]) -> Result<Inference>
pub fn submit_host(self, inputs: &[&[u8]]) -> Result<Inference>
Stage host inputs into this reserved slot and enqueue inference.
Sourcepub fn submit_host_with(
self,
write: impl FnMut(usize, &mut [u8]) -> Result<()>,
) -> Result<Inference>
pub fn submit_host_with( self, write: impl FnMut(usize, &mut [u8]) -> Result<()>, ) -> Result<Inference>
Publish directly into the exclusively leased slot’s host staging. The callback runs once per input, in order, before any GPU work is submitted. An error releases the slot without executing the graph. Unwritten bytes retain their previous contents: initialize every byte the graph can read. This supports packed variable-length inputs without building or clearing a capacity-sized temporary host buffer.
Sourcepub fn submit(self, inputs: &[DeviceTensor]) -> Result<Inference>
pub fn submit(self, inputs: &[DeviceTensor]) -> Result<Inference>
Copy device inputs into fixed slot addresses and enqueue the model. Input producers are ordered and failures propagate without host waits.
Auto Trait Implementations§
impl !RefUnwindSafe for ModelSlot
impl !UnwindSafe for ModelSlot
impl Freeze for ModelSlot
impl Send for ModelSlot
impl Sync for ModelSlot
impl Unpin for ModelSlot
impl UnsafeUnpin for ModelSlot
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
Mutably borrows from an owned value. Read more
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more