ferrum_kernels/backend/mod.rs
1//! Unified Backend trait for CUDA, Metal, and CPU compute.
2//!
3//! Each backend implements the same set of transformer-layer primitives
4//! (GEMM, norms, RoPE, attention, activations). `layer_forward()` and
5//! `ModelRunner` are generic over `Backend`, so one forward path serves
6//! all hardware targets.
7
8mod traits;
9pub use traits::*;
10
11mod types;
12pub use types::*;
13
14mod capabilities;
15
16mod kv_layer;
17pub use kv_layer::*;
18
19pub mod dtype;
20pub use dtype::{Dtype, HostDtype};
21
22pub mod buffer;
23pub use buffer::CpuBuf;
24#[cfg(feature = "cuda")]
25pub use buffer::CudaBuf;
26
27pub mod cpu;
28
29#[cfg(feature = "metal")]
30pub mod metal;
31
32#[cfg(feature = "cuda")]
33pub mod cuda;
34
35pub mod timer;