pub struct CodeGenerator { /* private fields */ }Expand description
Code generator for different backends
Implementations§
Source§impl CodeGenerator
impl CodeGenerator
Sourcepub fn new(device: DeviceType) -> Self
pub fn new(device: DeviceType) -> Self
Create a new code generator for the target device
Sourcepub fn generate(
&self,
graph: &ComputationGraph,
) -> JitResult<Vec<CompiledKernel>>
pub fn generate( &self, graph: &ComputationGraph, ) -> JitResult<Vec<CompiledKernel>>
Generate code for the computation graph
Sourcepub fn generate_from_ir(
&self,
ir_module: &IrModule,
) -> JitResult<Vec<CompiledKernel>>
pub fn generate_from_ir( &self, ir_module: &IrModule, ) -> JitResult<Vec<CompiledKernel>>
Generate code from IR module
Sourcepub fn generate_interpreter_from_ir(
&self,
ir_module: &IrModule,
) -> JitResult<Vec<CompiledKernel>>
pub fn generate_interpreter_from_ir( &self, ir_module: &IrModule, ) -> JitResult<Vec<CompiledKernel>>
Generate interpreter kernels from IR
Sourcepub fn generate_interpreter(
&self,
graph: &ComputationGraph,
) -> JitResult<Vec<CompiledKernel>>
pub fn generate_interpreter( &self, graph: &ComputationGraph, ) -> JitResult<Vec<CompiledKernel>>
Generate interpreter-based kernels (fallback)
Auto Trait Implementations§
impl Freeze for CodeGenerator
impl RefUnwindSafe for CodeGenerator
impl Send for CodeGenerator
impl Sync for CodeGenerator
impl Unpin for CodeGenerator
impl UnsafeUnpin for CodeGenerator
impl UnwindSafe for CodeGenerator
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> 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