Skip to main content

ronn_core/
lib.rs

1//! RONN Core Runtime Engine
2//!
3//! This crate provides the foundational components of the RONN (Rust ONNX Neural Network)
4//! runtime, including tensor operations, model graph representation, and core execution
5//! interfaces.
6//!
7//! ## Architecture
8//!
9//! The core engine follows a layered architecture:
10//! - **Types**: Fundamental data structures for tensors, graphs, and metadata
11//! - **Session**: Management of inference sessions and resource isolation
12//! - **Tensor**: Multi-dimensional array operations with Candle integration
13//! - **Graph**: Model representation and manipulation utilities
14//!
15//! ## Example
16//!
17//! ```rust
18//! use ronn_core::{Tensor, DataType, TensorLayout};
19//!
20//! // Create a 2x3 tensor with zeros
21//! let tensor = Tensor::zeros(vec![2, 3], DataType::F32, TensorLayout::RowMajor)?;
22//! assert_eq!(tensor.shape(), vec![2, 3]);
23//! assert_eq!(tensor.numel(), 6);
24//! # Ok::<(), Box<dyn std::error::Error>>(())
25//! ```
26
27// Lint configuration is in workspace Cargo.toml
28
29/// Error types for core operations
30pub mod error;
31pub mod graph;
32pub mod logging;
33pub mod memory_pool;
34pub mod ops;
35pub mod profiling;
36pub mod session;
37pub mod simd;
38pub mod tensor;
39pub mod types;
40
41// Re-export commonly used types
42pub use error::{CoreError, Result};
43pub use graph::{GraphBuilder, GraphStatistics};
44pub use memory_pool::{MemoryPool, PoolConfig, PoolStats, PooledBuffer, global_pool};
45pub use ops::{ArithmeticOps, MatrixOps, ReductionOps, ShapeOps};
46pub use profiling::{
47    CategoryStats, OperationStats, ProfileConfig, ProfileEvent, ProfileReport, Profiler,
48    global_profiler, init_profiler,
49};
50pub use session::{
51    GlobalStatistics, InferenceSession, SessionConfig, SessionManager, SessionStatistics,
52};
53pub use simd::{SimdFeatures, SimdLevel, simd_features};
54pub use tensor::Tensor;
55pub use types::{
56    AttributeValue, CompiledKernel, DataType, ExecutionProvider, GraphEdge, GraphNode, KernelStats,
57    MemoryInfo, MemoryType, MemoryUsage, ModelGraph, NodeAttribute, NodeId, OperatorSpec,
58    OptimizationLevel, PerformanceProfile, ProviderCapability, ProviderConfig, ProviderId,
59    ProviderType, ResourceRequirements, SessionId, SubGraph, TensorAllocator, TensorBuffer,
60    TensorLayout,
61};