mlx_cpu/lib.rs
1//! Pure Rust CPU backend — correctness oracle for conformance testing.
2//!
3//! This crate re-exports the built-in CPU reference backend from `mlx-core`
4//! and will later provide optimized kernels (SIMD, rayon parallelism) as an
5//! upgrade path.
6
7pub use mlx_core::cpu_kernels::CpuRefBackend;
8
9/// Create a new [`mlx_core::backend::Stream`] backed by the CPU reference backend.
10pub fn cpu_stream() -> std::sync::Arc<mlx_core::backend::Stream> {
11 std::sync::Arc::new(mlx_core::backend::Stream::new(Box::new(CpuRefBackend)))
12}