Enum Op

Source
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

Fields

§res: Var
§arg: u8
§index: Index
§

StoreGlobal

Store arg into res at index

Fields

§res: u8
§index: Index
§arg: Var
§

DeclareVar

Declare register variable id with dtype and optionally with given length (as a vector)

Fields

§dtype: DType
§id: u8
§len: Option<u8>
§

DeclareLocalVar

Declare local memory variable with id, dtype and given length

Fields

§id: u8
§dtype: DType
§len: usize
§

InitIndex

Initialize index id with value

Fields

§id: u8
§value: String
§

DeclareIndex

Declare index

Fields

§id: u8
§

SetIndex

Set index to value

Fields

§id: u8
§value: String
§

InitAccumulator

Initialize accumulator, if sum_reduce is true, then initilize to zero, otherwise initilize to minimum of dtype.

Fields

§id: u8
§dtype: DType
§is_sum_reduce: bool
§len: Option<u8>
§

Unary

Unary op

Fields

§res: Var
§x: Var
§op: UOp
§

Binary

Binary op

Fields

§res: Var
§x: Var
§y: Var
§op: BOp
§

Where

Where, x is condition, y is if true, otherwise z

Fields

§res: Var
§x: Var
§y: Var
§z: Var
§

Loop

Loop in kernel (register/private)

Fields

§name: String
§upper_bound: usize
§step: usize
§

IfBlock

If condition

Fields

§condition: String
§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.