Phase 1 of the rustytorch f32→f64 plan, backend layer. All 11 ops modules (basic/creation/unary/gemm/reduction/activation/shape/conv/pooling/normalization/ attention) are now generic over the element via a `CpuFloat` bound (`num_traits::Float + Send + Sync + 'static`); f32/Vec<f32> → E/Vec<E>, literals → E::zero()/one()/from(..). The ops were already pure scalar + rayon (no SIMD), so the f32 path is byte-identical (E inferred as f32 under CpuBackend) — no SIMD/BLAS dual-path needed. Adds `CpuBackendF64` (FloatElem = f64, TensorPrimitive = CpuTensorPrimitive<D,f64>) delegating to the same generic ops, plus the DeviceOps<CpuBackendF64> impl. CpuBackend (f32) untouched. Validated: 35 tests pass (33 original f32 + 2 new f64); `cpu_backend_f64_exceeds_ f32_precision` preserves 1+2^-30 (f32 rounds to 1.0) — proves genuine f64. rtx-tensor (dependent) still builds. clippy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
30 lines
668 B
TOML
30 lines
668 B
TOML
[package]
|
|
name = "rtx-backend-cpu"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
authors.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
description = "CPU backend for RustyTorch++"
|
|
keywords = ["tensor", "machine-learning", "cpu"]
|
|
categories = ["science", "mathematics"]
|
|
|
|
[dependencies]
|
|
rtx-backend = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
num-traits = "0.2"
|
|
parking_lot = { workspace = true }
|
|
rand = { workspace = true }
|
|
rand_distr = { workspace = true }
|
|
rayon = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
tempfile = { workspace = true }
|
|
|
|
[features]
|
|
default = []
|
|
simd = [] # Enable SIMD optimizations
|
|
|
|
[lints]
|
|
workspace = true
|