Skip to main content

product_os_compute/
lib.rs

1//! # Product OS Compute
2//!
3//! Portable compute runtime for Product OS with a stable facade over:
4//! - shared runtime traits and `DeviceBufferF32`
5//! - the implemented CPU SIMD backend
6//! - optional CUDA and Metal backend crates
7//! - reserved Phase 2 stub backends for AMD, TPU, and NVPTX
8//!
9//! Implemented backends:
10//! - `backend_cpu_simd`
11//! - `backend_cuda`
12//! - `backend_metal`
13//!
14//! Reserved stub feature flags:
15//! - `backend_amd`
16//! - `backend_tpu`
17//! - `backend_nvptx`
18//!
19//! CPU-only builds do not compile GPU `bindgen` / native shim build dependencies.
20
21#![deny(missing_docs)]
22
23#[path = "../core/src/runtime/mod.rs"]
24pub mod runtime;
25
26#[path = "../core/src/device_buffer.rs"]
27pub mod device_buffer;
28
29/// Backend namespaces.
30pub mod backend;
31
32pub use device_buffer::{
33    BlasLevel3BuffersF32, DeviceBufferF32, DeviceMemF32, MatrixLayoutDeviceF32,
34    MatrixLayoutDeviceF32Mut,
35};
36
37#[cfg(feature = "backend_cpu_simd")]
38pub use backend::cpu_simd::CpuSimdDevice;
39
40#[cfg(feature = "backend_cuda")]
41pub use cuda_backend::CudaDevice;
42
43#[cfg(feature = "backend_metal")]
44pub use metal_backend::MetalDevice;
45
46#[cfg(feature = "backend_amd")]
47pub use backend::amd::AmdDevice;
48
49#[cfg(feature = "backend_tpu")]
50pub use backend::tpu::TpuDevice;
51
52#[cfg(feature = "backend_nvptx")]
53pub use backend::nvptx::NvPtxDevice;
54
55#[cfg(feature = "backend_cuda")]
56#[path = "../backends/cuda/src/lib.rs"]
57mod cuda_backend;
58
59#[cfg(feature = "backend_metal")]
60#[path = "../backends/metal/src/lib.rs"]
61mod metal_backend;