BatchKernel

Trait BatchKernel 

Source
pub trait BatchKernel<I, O>: GpuKernel
where I: Send + Sync, O: Send + Sync,
{ // Required method fn execute<'life0, 'async_trait>( &'life0 self, input: I, ) -> Pin<Box<dyn Future<Output = Result<O>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided method fn validate_input(&self, _input: &I) -> Result<()> { ... } }
Expand description

Trait for batch (CPU-orchestrated) kernels.

Batch kernels are launched on-demand with CPU orchestration. They have 10-50μs launch overhead and state resides in CPU memory.

§Type Parameters

  • I: Input type
  • O: Output type

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, input: I, ) -> Pin<Box<dyn Future<Output = Result<O>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute the kernel with the given input.

§Arguments
  • input - The input data for the kernel
§Returns

The kernel output or an error.

Provided Methods§

Source

fn validate_input(&self, _input: &I) -> Result<()>

Validate the input before execution.

Override to provide custom input validation.

Implementors§