Skip to main content

RingKernelRuntime

Trait RingKernelRuntime 

Source
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>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: '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<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn kernel_metrics(&self, kernel_id: &KernelId) -> Option<KernelMetrics> { ... }
}
Expand description

Backend-agnostic runtime trait for kernel management.

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

Required Methods§

Source

fn backend(&self) -> Backend

Get the backend type.

Source

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

Check if a specific backend is available.

Source

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

Launch a kernel.

Source

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

Get a handle to an existing kernel.

Source

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

List all kernel IDs.

Source

fn metrics(&self) -> RuntimeMetrics

Get runtime metrics.

Source

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

Shutdown the runtime and terminate all kernels.

Provided Methods§

Source

fn kernel_metrics(&self, kernel_id: &KernelId) -> Option<KernelMetrics>

Get per-kernel metrics for a specific kernel.

Returns detailed metrics for the kernel identified by kernel_id, including message counts, queue depths, uptime, state, and whether the kernel is GPU-launched. Returns None if the kernel is not found.

Implementors§