ghostflow_core/
lib.rs

1//! GhostFlow Core - High-performance tensor operations
2//! 
3//! This crate provides the foundational tensor type and operations
4//! for the GhostFlow ML framework.
5//!
6//! ## Phase 4 Optimizations (Beat JAX!)
7//! - Operation fusion engine
8//! - JIT compilation
9//! - Memory layout optimization
10//! - Custom optimized kernels
11
12pub mod dtype;
13pub mod shape;
14pub mod storage;
15pub mod tensor;
16pub mod ops;
17pub mod device;
18pub mod error;
19pub mod serialize;
20
21// Phase 4: Advanced optimizations
22pub mod fusion;
23pub mod jit;
24pub mod layout;
25
26pub use dtype::DType;
27pub use shape::{Shape, Strides};
28pub use storage::Storage;
29pub use tensor::Tensor;
30pub use device::{Device, Cpu};
31pub use error::{GhostError, Result};
32pub use serialize::{StateDict, save_state_dict, load_state_dict, Serializable};
33
34// Phase 4 exports
35pub use fusion::{FusionEngine, ComputeGraph, FusionPattern};
36pub use jit::{JitCompiler, CompiledKernel};
37pub use layout::{LayoutOptimizer, MemoryLayout, DeviceInfo};
38
39/// Prelude for convenient imports
40#[allow(unused_imports)]
41pub mod prelude {
42    pub use crate::{Tensor, DType, Shape, Device, Cpu};
43    pub use crate::tensor_ops::*;
44    pub use crate::serialize::{StateDict, save_state_dict, load_state_dict, Serializable};
45    pub use crate::{FusionEngine, JitCompiler, LayoutOptimizer};
46}
47
48/// Tensor operations trait extensions
49#[allow(unused_imports)]
50pub mod tensor_ops {
51    pub use crate::ops::arithmetic::*;
52    pub use crate::ops::reduction::*;
53    pub use crate::ops::activation::*;
54    pub use crate::ops::matmul::*;
55}