pub struct KernelContext {
pub global_counter: usize,
pub local_counter: usize,
pub buffer_map: HashMap<UOpKey, Arc<UOp>>,
pub vars: HashMap<String, (Arc<UOp>, Option<i64>)>,
pub range_counter: usize,
}Expand description
Context for tracking state during kernel splitting.
Simplified from original 8 fields to 6 fields, removing Morok-specific
kernel_deps and buffer_id_mapping that are no longer needed after
aligning with fix_assign approach.
Fields§
§global_counter: usize§local_counter: usize§buffer_map: HashMap<UOpKey, Arc<UOp>>§vars: HashMap<String, (Arc<UOp>, Option<i64>)>Bound variables: maps variable name → (DEFINE_VAR UOp, optional bound value). Populated when BIND(DEFINE_VAR, CONST) is stripped during kernel splitting. The UOp is kept for kernel sources; the i64 is the concrete bound value (None for OUTER ranges).
range_counter: usizeImplementations§
Source§impl KernelContext
impl KernelContext
pub fn new() -> Self
pub fn next_global(&mut self) -> usize
pub fn next_local(&mut self) -> usize
pub fn next_range(&mut self) -> usize
pub fn has_buffer(&self, buf: &Arc<UOp>) -> bool
pub fn get_buffer(&self, buf: &Arc<UOp>) -> Option<&Arc<UOp>>
pub fn map_buffer(&mut self, original: Arc<UOp>, replacement: Arc<UOp>)
Trait Implementations§
Source§impl Clone for KernelContext
impl Clone for KernelContext
Source§fn clone(&self) -> KernelContext
fn clone(&self) -> KernelContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KernelContext
impl !RefUnwindSafe for KernelContext
impl Send for KernelContext
impl Sync for KernelContext
impl Unpin for KernelContext
impl UnsafeUnpin for KernelContext
impl !UnwindSafe for KernelContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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