1#![warn(missing_docs)]
38#![deny(clippy::unwrap_used, clippy::panic)]
39
40pub mod adaptive;
41pub mod error;
42pub mod gpu_ml;
43pub mod gpu_terrain;
44pub mod kernels;
45pub mod memory_compaction;
46pub mod memory_pool;
47pub mod multi_gpu;
48pub mod pipeline_builder;
49pub mod profiling;
50pub mod shader_compiler;
51
52pub use adaptive::{
54 AdaptiveConfig, AdaptiveSelector, Algorithm, AlgorithmStats, DeviceInfo, ExecutionStrategy,
55 TuningParams, WorkloadInfo,
56};
57pub use error::{GpuAdvancedError, Result};
58pub use gpu_ml::{ActivationType, GpuMlInference, InferenceStats, PoolType};
59pub use gpu_terrain::{GpuTerrainAnalyzer, TerrainMetrics};
60pub use kernels::{
61 EdgeDetectionKernel, FftKernel, HistogramEqKernel, KernelParams, KernelRegistry,
62 MatrixMultiplyKernel, MorphologyKernel, TextureAnalysisKernel,
63};
64pub use memory_compaction::{
65 CompactionConfig, CompactionResult, CompactionStats, CompactionStrategy, FragmentationInfo,
66 MemoryCompactor,
67};
68pub use memory_pool::{MemoryAllocation, MemoryPool, MemoryPoolStats};
69pub use multi_gpu::{
70 GpuDevice, GpuDeviceInfo, MultiGpuManager, SelectionStrategy,
71 affinity::{AffinityGuard, AffinityManager, AffinityStats},
72 device_manager::{DeviceCapabilities, DeviceFilter, DeviceManager, DevicePerformanceClass},
73 load_balancer::{LoadBalancer, LoadStats},
74 sync::{Barrier, Event, Fence, GpuSemaphore, SemaphoreGuard, SyncManager, SyncStats},
75 work_queue::{BatchSubmitter, WorkQueue, WorkStealingQueue},
76};
77pub use pipeline_builder::{
78 Pipeline, PipelineBuilder, PipelineConfig, PipelineInfo, PipelineStage,
79};
80pub use profiling::{
81 BottleneckKind, BottleneckSeverity, GpuProfiler, KernelStats, PerformanceBottleneck,
82 ProfileSession, ProfilingConfig, ProfilingMetrics, ProfilingReport,
83};
84pub use shader_compiler::{
85 CompiledShader, CompilerStats, ShaderCompiler, ShaderPreprocessor,
86 analyzer::{PerformanceClass, ShaderAnalysis, ShaderAnalyzer},
87 cache::{CacheStats, ShaderCache},
88 optimizer::{OptimizationConfig, OptimizationLevel, OptimizationMetrics, ShaderOptimizer},
89};
90
91pub const VERSION: &str = env!("CARGO_PKG_VERSION");
93
94pub const NAME: &str = env!("CARGO_PKG_NAME");
96
97pub fn info() -> LibraryInfo {
99 LibraryInfo {
100 name: NAME.to_string(),
101 version: VERSION.to_string(),
102 description: "Advanced GPU computing with multi-GPU support for OxiGDAL".to_string(),
103 }
104}
105
106#[derive(Debug, Clone)]
108pub struct LibraryInfo {
109 pub name: String,
111 pub version: String,
113 pub description: String,
115}
116
117impl LibraryInfo {
118 pub fn print(&self) {
120 println!("{} v{}", self.name, self.version);
121 println!("{}", self.description);
122 }
123}
124
125#[cfg(test)]
126mod tests {
127 use super::*;
128
129 #[test]
130 fn test_library_info() {
131 let info = info();
132 assert_eq!(info.name, NAME);
133 assert_eq!(info.version, VERSION);
134 assert!(!info.description.is_empty());
135 }
136
137 #[test]
138 fn test_version() {
139 assert!(!VERSION.is_empty());
140 assert!(VERSION.contains('.'));
141 }
142}