pub trait KernelCompiler: Send + Sync {
// Required method
fn compile_kernel(
&self,
name: &str,
function_bytecode: &[u8],
config: &KernelCompileConfig,
) -> Result<SimulationKernelFn, String>;
// Provided method
fn supports_feature(&self, feature: &str) -> bool { ... }
}Expand description
Trait for JIT kernel compilation.
This trait is implemented by shape-jit::JITCompiler and injected into
ExecutionContext to enable JIT kernel compilation without circular dependencies.
The bytecode is passed as raw bytes since we can’t reference BytecodeProgram here.
Required Methods§
Sourcefn compile_kernel(
&self,
name: &str,
function_bytecode: &[u8],
config: &KernelCompileConfig,
) -> Result<SimulationKernelFn, String>
fn compile_kernel( &self, name: &str, function_bytecode: &[u8], config: &KernelCompileConfig, ) -> Result<SimulationKernelFn, String>
Provided Methods§
Sourcefn supports_feature(&self, feature: &str) -> bool
fn supports_feature(&self, feature: &str) -> bool
Check if the compiler supports a given feature.