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§
Sourcefn operation_type(&self) -> OperationType
fn operation_type(&self) -> OperationType
Get operation type
Sourcefn backend_type(&self) -> BackendType
fn backend_type(&self) -> BackendType
Get backend type
Sourcefn characteristics(&self) -> KernelCharacteristics
fn characteristics(&self) -> KernelCharacteristics
Get kernel characteristics
Sourcefn constraints(&self) -> KernelConstraints
fn constraints(&self) -> KernelConstraints
Get kernel constraints
Sourcefn execute(&self, inputs: &KernelInputs) -> Result<KernelOutputs>
fn execute(&self, inputs: &KernelInputs) -> Result<KernelOutputs>
Execute the kernel
Sourcefn benchmark(
&self,
inputs: &KernelInputs,
iterations: usize,
) -> Result<BenchmarkResult>
fn benchmark( &self, inputs: &KernelInputs, iterations: usize, ) -> Result<BenchmarkResult>
Benchmark the kernel