cubecl_core::ir

Trait LocalAllocator

Source
pub trait LocalAllocator {
    // Required methods
    fn create_local_variable(
        &self,
        root: Rc<RefCell<Scope>>,
        scope: Rc<RefCell<Scope>>,
        item: Item,
    ) -> ExpandElement;
    fn create_local_binding(
        &self,
        root: Rc<RefCell<Scope>>,
        scope: Rc<RefCell<Scope>>,
        item: Item,
    ) -> ExpandElement;
    fn create_local_undeclared(
        &self,
        root: Rc<RefCell<Scope>>,
        scope: Rc<RefCell<Scope>>,
        item: Item,
    ) -> ExpandElement;
}
Expand description

Defines a local variable allocation strategy (i.e. reused mutable variables, SSA)

Required Methods§

Source

fn create_local_variable( &self, root: Rc<RefCell<Scope>>, scope: Rc<RefCell<Scope>>, item: Item, ) -> ExpandElement

Creates a local variable that can be (re)assigned

Source

fn create_local_binding( &self, root: Rc<RefCell<Scope>>, scope: Rc<RefCell<Scope>>, item: Item, ) -> ExpandElement

Creates an immutable local binding for intermediates

Source

fn create_local_undeclared( &self, root: Rc<RefCell<Scope>>, scope: Rc<RefCell<Scope>>, item: Item, ) -> ExpandElement

Creates an undeclared local binding that must not be reused regardless of allocator

Implementors§