Skip to main content

GpuStream

Struct GpuStream 

Source
pub struct GpuStream<'a> { /* private fields */ }
Expand description

Handle to an orchestrated pipeline. Couples a compiled megakernel to its submission + completion infrastructure.

Implementations§

Source§

impl<'a> GpuStream<'a>

Source

pub fn new() -> Self

Create a pipeline handle with no io_uring stream attached.

§Examples
use vyre_runtime::GpuStream;

let stream = GpuStream::new();

assert!(!stream.is_shutdown_requested());
Source

pub fn with_uring(self, stream: AsyncUringStream<'a>) -> Self

Attach an io_uring stream for GPU-visible reads. Linux-only.

Use uring::NvmeGpuIngestDriver::new_gpudirect when the caller requires the native NVMe → BAR1 path instead of registered mapped reads.

Source

pub fn poll(&mut self) -> Result<u32, PipelineError>

Reap completions and bump the megakernel tail pointer.

§Errors

Propagates any uring syscall error from the underlying ring.

Source

pub fn request_shutdown(&mut self)

Request graceful shutdown of the pipeline.

Source

pub fn is_shutdown_requested(&self) -> bool

Whether shutdown has been requested.

Source

pub unsafe fn wait_for_observable( host_visible_addr: *const u32, current: u32, timeout_ns: u64, ) -> Result<(), PipelineError>

Block until the megakernel writes a new value into the observable word. Uses futex_waitv on Linux 5.16+.

§Errors
§Safety

host_visible_addr must be host-mapped and outlive this call.

Trait Implementations§

Source§

impl Default for GpuStream<'_>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GpuStream<'a>

§

impl<'a> RefUnwindSafe for GpuStream<'a>

§

impl<'a> Send for GpuStream<'a>

§

impl<'a> Sync for GpuStream<'a>

§

impl<'a> Unpin for GpuStream<'a>

§

impl<'a> UnsafeUnpin for GpuStream<'a>

§

impl<'a> !UnwindSafe for GpuStream<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more