Skip to main content

CustomKernel

Trait CustomKernel 

Source
pub trait CustomKernel:
    Debug
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn operation_type(&self) -> OperationType;
    fn backend_type(&self) -> BackendType;
    fn characteristics(&self) -> KernelCharacteristics;
    fn constraints(&self) -> KernelConstraints;
    fn execute(&self, inputs: &KernelInputs) -> Result<KernelOutputs>;
    fn benchmark(
        &self,
        inputs: &KernelInputs,
        iterations: usize,
    ) -> Result<BenchmarkResult>;
}
Expand description

Custom kernel trait for user-defined kernels

Required Methods§

Source

fn name(&self) -> &str

Get kernel name

Source

fn operation_type(&self) -> OperationType

Get operation type

Source

fn backend_type(&self) -> BackendType

Get backend type

Source

fn characteristics(&self) -> KernelCharacteristics

Get kernel characteristics

Source

fn constraints(&self) -> KernelConstraints

Get kernel constraints

Source

fn execute(&self, inputs: &KernelInputs) -> Result<KernelOutputs>

Execute the kernel

Source

fn benchmark( &self, inputs: &KernelInputs, iterations: usize, ) -> Result<BenchmarkResult>

Benchmark the kernel

Implementors§