ringkernel_cpu/lib.rs
1//! CPU Backend for RingKernel
2//!
3//! This crate provides a CPU-based implementation of the RingKernel runtime,
4//! primarily used for testing and as a fallback when no GPU is available.
5//!
6//! # Features
7//!
8//! - Full implementation of the RingKernelRuntime trait
9//! - Simulates GPU execution using async tasks
10//! - Supports all kernel lifecycle operations
11//! - Useful for unit testing and development
12//!
13//! # Example
14//!
15//! ```ignore
16//! use ringkernel_cpu::CpuRuntime;
17//! use ringkernel_core::runtime::{RuntimeBuilder, Backend};
18//!
19//! #[tokio::main]
20//! async fn main() {
21//! let runtime = CpuRuntime::new().await.unwrap();
22//! let kernel = runtime.launch("my_kernel", Default::default()).await.unwrap();
23//! kernel.activate().await.unwrap();
24//! }
25//! ```
26
27#![warn(missing_docs)]
28
29mod kernel;
30mod memory;
31pub mod mock;
32mod runtime;
33pub mod simd;
34
35pub use kernel::CpuKernel;
36pub use memory::CpuBuffer;
37pub use mock::{MockAtomics, MockGpu, MockKernelConfig, MockSharedMemory, MockThread, MockWarp};
38pub use runtime::CpuRuntime;
39pub use simd::SimdOps;
40
41/// Prelude for convenient imports.
42pub mod prelude {
43 pub use crate::mock::{
44 MockAtomics, MockGpu, MockKernelConfig, MockSharedMemory, MockThread, MockWarp,
45 };
46 pub use crate::simd::SimdOps;
47 pub use crate::CpuKernel;
48 pub use crate::CpuRuntime;
49}