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>
impl<'a> GpuStream<'a>
Sourcepub fn new() -> Self
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());Sourcepub fn with_uring(self, stream: AsyncUringStream<'a>) -> Self
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.
Sourcepub fn poll(&mut self) -> Result<u32, PipelineError>
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.
Sourcepub fn request_shutdown(&mut self)
pub fn request_shutdown(&mut self)
Request graceful shutdown of the pipeline.
Sourcepub fn is_shutdown_requested(&self) -> bool
pub fn is_shutdown_requested(&self) -> bool
Whether shutdown has been requested.
Sourcepub unsafe fn wait_for_observable(
host_visible_addr: *const u32,
current: u32,
timeout_ns: u64,
) -> Result<(), PipelineError>
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
PipelineError::NotLinuxon non-Linux hosts.PipelineError::IoUringSyscallon futex errors.
§Safety
host_visible_addr must be host-mapped and outlive this call.
Trait Implementations§
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> 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