pub struct MegakernelResidentBatchScratch { /* private fields */ }Expand description
Reusable host scratch for batched resident-handle megakernel dispatch.
This scratch owns the transient resource rows submitted to the backend and
the nested host readback buffers returned by batched dispatch. Reusing one
value across repeated batches avoids rebuilding Vec<[Resource; 4]>,
Vec<Vec<Vec<u8>>>, and per-output byte slots in many-small-launch loops.
Implementations§
Source§impl MegakernelResidentBatchScratch
impl MegakernelResidentBatchScratch
Sourcepub fn with_capacity(batch_count: usize, output_slots_per_batch: usize) -> Self
pub fn with_capacity(batch_count: usize, output_slots_per_batch: usize) -> Self
Preallocate scratch for a known hot batch shape.
Sourcepub fn try_with_capacity(
batch_count: usize,
output_slots_per_batch: usize,
) -> Result<Self, PipelineError>
pub fn try_with_capacity( batch_count: usize, output_slots_per_batch: usize, ) -> Result<Self, PipelineError>
Preallocate scratch for a known hot batch shape with explicit allocation failure reporting.
Sourcepub fn batches(&self) -> &[OutputBuffers] ⓘ
pub fn batches(&self) -> &[OutputBuffers] ⓘ
Retained decoded output batches from the most recent dispatch.
Sourcepub fn batches_mut(&mut self) -> &mut Vec<OutputBuffers> ⓘ
pub fn batches_mut(&mut self) -> &mut Vec<OutputBuffers> ⓘ
Mutable retained output batches for callers that want to drain or decode in place after dispatch.
Sourcepub fn resource_capacity(&self) -> usize
pub fn resource_capacity(&self) -> usize
Current retained resource-row capacity.
Sourcepub fn batch_capacity(&self) -> usize
pub fn batch_capacity(&self) -> usize
Current retained batch-row capacity.
Trait Implementations§
Source§impl Default for MegakernelResidentBatchScratch
impl Default for MegakernelResidentBatchScratch
Source§fn default() -> MegakernelResidentBatchScratch
fn default() -> MegakernelResidentBatchScratch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MegakernelResidentBatchScratch
impl RefUnwindSafe for MegakernelResidentBatchScratch
impl Send for MegakernelResidentBatchScratch
impl Sync for MegakernelResidentBatchScratch
impl Unpin for MegakernelResidentBatchScratch
impl UnsafeUnpin for MegakernelResidentBatchScratch
impl UnwindSafe for MegakernelResidentBatchScratch
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