pub enum Op {
Show 16 variants
LoadGlobal {
res: Var,
arg: u8,
index: Index,
},
StoreGlobal {
res: u8,
index: Index,
arg: Var,
},
DeclareVar {
dtype: DType,
id: u8,
len: Option<u8>,
},
DeclareLocalVar {
id: u8,
dtype: DType,
len: usize,
},
InitIndex {
id: u8,
value: String,
},
DeclareIndex {
id: u8,
},
SetIndex {
id: u8,
value: String,
},
InitAccumulator {
id: u8,
dtype: DType,
is_sum_reduce: bool,
len: Option<u8>,
},
Unary {
res: Var,
x: Var,
op: UOp,
},
Binary {
res: Var,
x: Var,
y: Var,
op: BOp,
},
Where {
res: Var,
x: Var,
y: Var,
z: Var,
},
Loop {
name: String,
upper_bound: usize,
step: usize,
},
IfBlock {
condition: String,
},
EndIf,
EndLoop,
LocalBarrier,
}
Expand description
Op for the compilers
Variants§
LoadGlobal
Load into res from arg at index
StoreGlobal
Store arg into res at index
DeclareVar
Declare register variable id with dtype and optionally with given length (as a vector)
DeclareLocalVar
Declare local memory variable with id, dtype and given length
InitIndex
Initialize index id with value
DeclareIndex
Declare index
SetIndex
Set index to value
InitAccumulator
Initialize accumulator, if sum_reduce is true, then initilize to zero, otherwise initilize to minimum of dtype.
Unary
Unary op
Binary
Binary op
Where
Where, x is condition, y is if true, otherwise z
Loop
Loop in kernel (register/private)
IfBlock
If condition
EndIf
End of if condition
EndLoop
End of loop
LocalBarrier
Local memory synchronization
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnwindSafe for Op
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