pub struct LocalAddBufferContext {
pub param_slot: usize,
pub map: IndexMap<UOpKey, Arc<UOp>>,
pub vars: HashMap<String, (Arc<UOp>, Option<i64>)>,
pub range: usize,
pub opts: Vec<ContiguousHint>,
}Expand description
Per-kernel context for tracking state during kernel splitting.
Based on LocalAddBufferContext.
This is used within split_store for each individual kernel being created.
IMPORTANT: Uses IndexMap for map to maintain insertion order.
This is critical because PARAM slot indices are assigned in the order
patterns match, and kernel sources must be in the same order for correct
buffer indexing during execution.
Fields§
§param_slot: usizePARAM slot counter (dg)
map: IndexMap<UOpKey, Arc<UOp>>Buffer → AFTER mapping (IndexMap maintains insertion order)
vars: HashMap<String, (Arc<UOp>, Option<i64>)>Bound variables: name → (DEFINE_VAR UOp, optional bound value).
range: usizeRange renumber counter
opts: Vec<ContiguousHint>Optimization hints extracted from CONTIGUOUS.opts (ctx.opts)
Implementations§
Source§impl LocalAddBufferContext
impl LocalAddBufferContext
pub fn new() -> Self
Sourcepub fn next_param_slot(&mut self) -> usize
pub fn next_param_slot(&mut self) -> usize
Get next PARAM slot index (ctx.dg).
Sourcepub fn next_range(&mut self) -> usize
pub fn next_range(&mut self) -> usize
Get next range renumber index.
Sourcepub fn add_var(&mut self, var: Arc<UOp>, value: Option<i64>)
pub fn add_var(&mut self, var: Arc<UOp>, value: Option<i64>)
Track a bound variable with its DEFINE_VAR UOp and concrete value.
Sourcepub fn map_buffer(&mut self, buf: Arc<UOp>, after: Arc<UOp>)
pub fn map_buffer(&mut self, buf: Arc<UOp>, after: Arc<UOp>)
Map a buffer to its AFTER wrapper.
Sourcepub fn has_buffer(&self, buf: &Arc<UOp>) -> bool
pub fn has_buffer(&self, buf: &Arc<UOp>) -> bool
Check if buffer is already mapped.
Trait Implementations§
Source§impl Default for LocalAddBufferContext
impl Default for LocalAddBufferContext
Source§fn default() -> LocalAddBufferContext
fn default() -> LocalAddBufferContext
Auto Trait Implementations§
impl Freeze for LocalAddBufferContext
impl !RefUnwindSafe for LocalAddBufferContext
impl Send for LocalAddBufferContext
impl Sync for LocalAddBufferContext
impl Unpin for LocalAddBufferContext
impl UnsafeUnpin for LocalAddBufferContext
impl !UnwindSafe for LocalAddBufferContext
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more