pub struct GpuTransferQueue { /* private fields */ }Expand description
GPU Transfer Queue for async bounded transfers
Toyota Way: Heijunka (Load Balancing)
- Bounded queue prevents memory explosion (Poka-Yoke)
- Max 2 in-flight keeps
PCIebus busy without overwhelming GPU - Async design prevents blocking Tokio reactor
References:
- Leis et al. (2014): Morsel-driven parallelism
Implementations§
Source§impl GpuTransferQueue
impl GpuTransferQueue
Sourcepub async fn enqueue(&self, batch: RecordBatch) -> Result<()>
pub async fn enqueue(&self, batch: RecordBatch) -> Result<()>
Enqueue a record batch for GPU transfer
This will block if queue is full (2 batches in-flight)
§Errors
Returns error if queue is closed
Sourcepub async fn dequeue(&mut self) -> Option<RecordBatch>
pub async fn dequeue(&mut self) -> Option<RecordBatch>
Dequeue a record batch from GPU transfer queue
§Returns
Next batch if available, None if queue is empty and closed
Sourcepub fn sender(&self) -> Sender<RecordBatch>
pub fn sender(&self) -> Sender<RecordBatch>
Get sender for concurrent enqueueing
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuTransferQueue
impl RefUnwindSafe for GpuTransferQueue
impl Send for GpuTransferQueue
impl Sync for GpuTransferQueue
impl Unpin for GpuTransferQueue
impl UnsafeUnpin for GpuTransferQueue
impl UnwindSafe for GpuTransferQueue
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