ironaccelerator_metal/lib.rs
1//! # `ironaccelerator-metal`
2//!
3//! Apple Metal backend. Will dispatch through:
4//!
5//! - **Metal Performance Shaders (MPS)** — `MPSMatrixMultiplication`, etc.
6//! - **MPSGraph** — JIT-compiled compute graphs, the "official" fast path.
7//! - **MLX-style kernels** — fused attention / RMSNorm / sampling kernels
8//! ported from MLX (Apple's ML framework).
9//! - **CoreML** — opportunistic offload to the Apple Neural Engine for
10//! subgraphs whose ops are ANE-supported.
11//!
12//! ## Status
13//!
14//! v0.1 scaffold: backend trait wired up. Apple-only FFI bindings (objc2 /
15//! metal-rs) gated behind `cfg(target_vendor = "apple")` will land next.
16
17#![warn(missing_docs)]
18#![allow(clippy::missing_safety_doc)]
19
20pub mod backend;
21
22#[cfg(target_vendor = "apple")]
23pub mod compute;
24#[cfg(target_vendor = "apple")]
25pub mod drv;
26
27pub use backend::{MetalBackend, METAL_BACKEND};
28#[cfg(target_vendor = "apple")]
29pub use compute::Context;
30
31/// Registers the Metal backend with `reg`.
32pub fn register(reg: &mut ironaccelerator_core::BackendRegistry) {
33 reg.register(&METAL_BACKEND);
34}