pub trait BatchKernel<I, O>: GpuKernel{
// 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 typeO: Output type
Required Methods§
Provided Methods§
Sourcefn validate_input(&self, _input: &I) -> Result<()>
fn validate_input(&self, _input: &I) -> Result<()>
Validate the input before execution.
Override to provide custom input validation.