pub struct RenderContext { /* private fields */ }Expand description
Maps UOp ID → LLVM variable name.
Implementations§
Source§impl RenderContext
impl RenderContext
pub fn new() -> Self
Sourcepub fn name(&mut self, uop: &Arc<UOp>) -> String
pub fn name(&mut self, uop: &Arc<UOp>) -> String
Get or create variable name for UOp.
For constants, returns literal value. For definitions, returns argument name. For other ops, returns a generated variable name.
Sourcepub fn register_range(&mut self, axis_id: usize, name: String)
pub fn register_range(&mut self, axis_id: usize, name: String)
Register a range value by axis_id.
Sourcepub fn register_reduce_pending(
&mut self,
reduce_id: u64,
acc_ptr: String,
dtype: String,
)
pub fn register_reduce_pending( &mut self, reduce_id: u64, acc_ptr: String, dtype: String, )
Register a pending reduce final load.
Sourcepub fn take_pending_reduces(&mut self) -> HashMap<u64, PendingReduce>
pub fn take_pending_reduces(&mut self) -> HashMap<u64, PendingReduce>
Take all pending reduces (empties map).
Sourcepub fn has_pending_reduces(&self) -> bool
pub fn has_pending_reduces(&self) -> bool
Check if there are pending reduces.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenderContext
impl RefUnwindSafe for RenderContext
impl Send for RenderContext
impl Sync for RenderContext
impl Unpin for RenderContext
impl UnsafeUnpin for RenderContext
impl UnwindSafe for RenderContext
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> 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