RingKernelRuntime

Trait RingKernelRuntime 

pub trait RingKernelRuntime: Send + Sync {
    // Required methods
    fn backend(&self) -> Backend;
    fn is_backend_available(&self, backend: Backend) -> bool;
    fn launch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        kernel_id: &'life1 str,
        options: LaunchOptions,
    ) -> Pin<Box<dyn Future<Output = Result<KernelHandle, RingKernelError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_kernel(&self, kernel_id: &KernelId) -> Option<KernelHandle>;
    fn list_kernels(&self) -> Vec<KernelId>;
    fn metrics(&self) -> RuntimeMetrics;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), RingKernelError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Backend-agnostic runtime trait for kernel management.

This trait is implemented by each backend (CPU, CUDA, Metal, WebGPU) to provide kernel lifecycle management and message passing.

Required Methods§

fn backend(&self) -> Backend

Get the backend type.

fn is_backend_available(&self, backend: Backend) -> bool

Check if a specific backend is available.

fn launch<'life0, 'life1, 'async_trait>( &'life0 self, kernel_id: &'life1 str, options: LaunchOptions, ) -> Pin<Box<dyn Future<Output = Result<KernelHandle, RingKernelError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Launch a kernel.

fn get_kernel(&self, kernel_id: &KernelId) -> Option<KernelHandle>

Get a handle to an existing kernel.

fn list_kernels(&self) -> Vec<KernelId>

List all kernel IDs.

fn metrics(&self) -> RuntimeMetrics

Get runtime metrics.

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

Shutdown the runtime and terminate all kernels.

Implementors§