pub struct MegakernelIoQueue { /* private fields */ }Expand description
Host-side handle to the megakernel IO queue. Wraps a Vec<u32> slot ring
and exposes typed poll/publish/complete entry points.
Implementations§
Source§impl MegakernelIoQueue
impl MegakernelIoQueue
Sourcepub fn new(slot_count: u32) -> Result<Self, PipelineError>
pub fn new(slot_count: u32) -> Result<Self, PipelineError>
Allocate an empty queue with slot_count entries.
§Errors
Returns PipelineError::QueueFull when slot_count is zero or
exceeds the IR/program’s fixed poll window of IO_SLOT_COUNT.
Sourcepub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_bytes(&mut self) -> &mut [u8] ⓘ
Mutably borrow the raw bytes for backend upload / host updates.
Sourcepub fn slot_count(&self) -> u32
pub fn slot_count(&self) -> u32
Queue capacity in slots.
Sourcepub fn publish_slot(
&mut self,
queue_slot: u32,
mapped_slot: u32,
byte_count: u32,
tag: u32,
) -> Result<(), PipelineError>
pub fn publish_slot( &mut self, queue_slot: u32, mapped_slot: u32, byte_count: u32, tag: u32, ) -> Result<(), PipelineError>
Publish a completed DMA slot so the megakernel can consume it.
The host writes the metadata first, then flips STATUS to
slot::PUBLISHED as the publication barrier.
§Errors
Returns PipelineError::QueueFull when the slot is out of bounds or
still owned by the GPU/host from a prior ingest.
Sourcepub fn submit_dma_read(
&mut self,
queue_slot: u32,
src_handle: u32,
dst_handle: u32,
byte_count: u32,
tag: u32,
) -> Result<(), PipelineError>
pub fn submit_dma_read( &mut self, queue_slot: u32, src_handle: u32, dst_handle: u32, byte_count: u32, tag: u32, ) -> Result<(), PipelineError>
Submit a DMA-read request to the IO queue.
This is the GPU-initiated path: the caller writes the request metadata,
then flips STATUS to slot::PUBLISHED so the host/runtime can claim
and service it.
§Errors
Returns PipelineError::QueueFull when the slot is out of bounds or
not empty.
Sourcepub fn completion(&self, queue_slot: u32) -> Option<IoCompletion>
pub fn completion(&self, queue_slot: u32) -> Option<IoCompletion>
Read the queue slot back as a completion record.
Sourcepub fn is_recycled(&self, queue_slot: u32) -> bool
pub fn is_recycled(&self, queue_slot: u32) -> bool
Return true when the GPU has recycled the slot to EMPTY.
Trait Implementations§
Source§impl Clone for MegakernelIoQueue
impl Clone for MegakernelIoQueue
Source§fn clone(&self) -> MegakernelIoQueue
fn clone(&self) -> MegakernelIoQueue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more