rustkernel_core/
lib.rs

1//! # RustKernel Core
2//!
3//! Core abstractions, traits, and registry for the RustKernels GPU kernel library.
4//!
5//! This crate provides:
6//! - Domain and kernel type definitions
7//! - Kernel metadata and configuration
8//! - Trait definitions for batch and ring kernels
9//! - Kernel registry with auto-discovery
10//! - Licensing and feature gating system
11//! - Actix actor integration for GPU-backed actors
12
13#![warn(missing_docs)]
14#![warn(clippy::all)]
15
16pub mod domain;
17pub mod error;
18pub mod k2k;
19pub mod kernel;
20pub mod license;
21pub mod messages;
22pub mod registry;
23pub mod slo;
24pub mod test_kernels;
25pub mod traits;
26
27// Re-exports from ringkernel-core for convenience
28pub use ringkernel_core::{
29    HlcTimestamp, MessageHeader, MessageId, MessageQueue, RingContext, RingKernelError, RingMessage,
30};
31
32// Re-export types from specific modules
33pub use ringkernel_core::hlc::HlcClock;
34pub use ringkernel_core::k2k::{K2KBroker, K2KEndpoint, K2KMessage};
35pub use ringkernel_core::message::MessageEnvelope;
36pub use ringkernel_core::runtime::{
37    KernelHandle, KernelId, KernelState, LaunchOptions, RingKernelRuntime,
38};
39
40/// Prelude module for convenient imports
41pub mod prelude {
42    pub use crate::domain::Domain;
43    pub use crate::error::{KernelError, Result};
44    pub use crate::k2k::{
45        FanOutTracker, IterativeConvergenceSummary, IterativeState, K2KControlMessage, K2KPriority,
46        K2KWorkerResult, PipelineTracker, ScatterGatherState, kernel_id_to_u64,
47    };
48    pub use crate::kernel::{KernelMetadata, KernelMode};
49    pub use crate::license::{DevelopmentLicense, License, LicenseError, LicenseValidator};
50    pub use crate::messages::{
51        BatchMessage, CorrelationId, KernelRequest, KernelResponse, KernelResult,
52    };
53    pub use crate::registry::{KernelRegistry, RegistryStats};
54    pub use crate::slo::{SLOResult, SLOValidator};
55    pub use crate::test_kernels::{EchoKernel, MatMul, ReduceSum, VectorAdd};
56    pub use crate::traits::{BatchKernel, GpuKernel, IterativeKernel, RingKernelHandler};
57
58    // Re-exports from ringkernel-core
59    pub use ringkernel_core::k2k::{K2KBroker, K2KEndpoint};
60    pub use ringkernel_core::runtime::{KernelHandle, KernelId, KernelState, LaunchOptions};
61    pub use ringkernel_core::{HlcTimestamp, MessageId, RingContext, RingMessage};
62}