Skip to main content

KernelExecutable

Struct KernelExecutable 

Source
pub struct KernelExecutable {
    pub name: String,
    pub kernel_source: String,
    pub entry_point: String,
    pub shape: Shape,
    pub dtype: DtypeRepr,
    pub runtime_op: Arc<dyn RuntimeOp>,
    pub backward_kernel_source: String,
    pub backward_entry_point: String,
}
Expand description

A lowered op that carries the kernel source needed for compilation.

Callers that have teeny-compiler as a dependency can pass kernel_source and kernel_entry_point to compile_kernel along with a chosen Target.

Fields§

§name: String§kernel_source: String§entry_point: String§shape: Shape§dtype: DtypeRepr§runtime_op: Arc<dyn RuntimeOp>

Runtime dispatch object: how to pack args and compute the launch grid. Input nodes carry a no-op implementation.

§backward_kernel_source: String

Backward kernel source. Empty if this op has no backward.

§backward_entry_point: String

Backward kernel entry point name.

Trait Implementations§

Source§

impl ExecutableOp for KernelExecutable

Source§

fn name(&self) -> &str

This op’s name.
Source§

fn is_input(&self) -> bool

Returns true for Input placeholder nodes, which carry no kernel.
Source§

fn forward_kernel_source(&self) -> &str

This op’s forward kernel source.
Source§

fn forward_kernel_entry_point(&self) -> &str

This op’s forward kernel entry-point symbol name.
Source§

fn output_shape(&self) -> &Shape

This op’s output shape.
Source§

fn output_dtype(&self) -> DtypeRepr

This op’s output dtype.
Source§

fn runtime_op(&self) -> Option<Arc<dyn RuntimeOp>>

Returns the runtime dispatch object for this op, or None for Input nodes.
Source§

fn backward_kernel_source(&self) -> &str

Returns the backward kernel source, or "" if no backward is available.
Source§

fn backward_kernel_entry_point(&self) -> &str

Returns the backward kernel entry point name.

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.