Skip to main content

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#[cfg(any(feature = "cuda", test))]
16mod native_status;
17
18#[cfg(any(feature = "cuda", test))]
19mod reusable_execution;
20
21mod kv_layer;
22pub use kv_layer::*;
23
24pub mod dtype;
25pub use dtype::{Dtype, HostDtype};
26
27pub mod buffer;
28pub use buffer::CpuBuf;
29#[cfg(feature = "cuda")]
30pub use buffer::CudaBuf;
31
32pub mod cpu;
33
34pub mod reference;
35
36#[cfg(feature = "metal")]
37pub mod metal;
38
39#[cfg(feature = "cuda")]
40pub mod cuda;
41
42pub mod timer;