pub struct DispatchFuture { /* private fields */ }Expand description
A future representing an in-flight GPU dispatch.
On the no-CUDA stub path this resolves immediately. On CUDA hosts the
future polls a cust::event::Event recorded on the launch stream:
event.query() returns Ok(()) once the GPU has finished the
associated work. Until then we re-schedule via the waker so the
wasmtime fiber can continue to be suspended.
The future carries a tracing::Span captured at construction time
(the active span belonging to whichever host function created it,
typically wasi_cuda.launch). Every poll call enters that span,
so any work — including the cust::event::Event::query poll path —
is attributed to the originating dispatch in the trace tree even
though poll is invoked from the Tokio runtime’s reactor, not from
inside the host function. Without this the dispatch’s poll events
would be parented to the runtime worker’s empty context and would
disappear from the distributed trace.
Implementations§
Source§impl DispatchFuture
impl DispatchFuture
Sourcepub fn ready(permit: DispatchPermit) -> Self
pub fn ready(permit: DispatchPermit) -> Self
Build a future bound to the given back-pressure permit. The future
resolves the next time it is polled (no-CUDA path) or once the
CUDA event has fired (CUDA path with bind_event).
Trait Implementations§
Source§impl Future for DispatchFuture
impl Future for DispatchFuture
Auto Trait Implementations§
impl !RefUnwindSafe for DispatchFuture
impl !UnwindSafe for DispatchFuture
impl Freeze for DispatchFuture
impl Send for DispatchFuture
impl Sync for DispatchFuture
impl Unpin for DispatchFuture
impl UnsafeUnpin for DispatchFuture
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> 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>
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>
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