-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
62 lines (51 loc) · 1.88 KB
/
lib.rs
File metadata and controls
62 lines (51 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! # RustKernel Financial Audit
//!
//! GPU-accelerated financial audit kernels.
//!
//! ## Kernels
//! - `FeatureExtraction` - Audit feature vector extraction for ML analysis
//! - `HypergraphConstruction` - Multi-way relationship hypergraph construction
#![warn(missing_docs)]
pub mod feature_extraction;
pub mod hypergraph;
pub mod types;
pub use feature_extraction::{FeatureConfig, FeatureExtraction};
pub use hypergraph::{HypergraphConfig, HypergraphConstruction};
pub use types::*;
/// Register all audit kernels.
pub fn register_all(
registry: &rustkernel_core::registry::KernelRegistry,
) -> rustkernel_core::error::Result<()> {
tracing::info!("Registering financial audit kernels");
// Feature extraction kernel (1) - Batch
registry.register_batch_metadata_from(feature_extraction::FeatureExtraction::new)?;
// Hypergraph kernel (1) - Batch
registry.register_batch_metadata_from(hypergraph::HypergraphConstruction::new)?;
tracing::info!("Registered 2 financial audit kernels");
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use rustkernel_core::{domain::Domain, registry::KernelRegistry, traits::GpuKernel};
#[test]
fn test_register_all() {
let registry = KernelRegistry::new();
register_all(®istry).expect("Failed to register audit kernels");
assert_eq!(registry.total_count(), 2);
}
#[test]
fn test_feature_extraction_metadata() {
let kernel = FeatureExtraction::new();
let metadata = kernel.metadata();
assert!(metadata.id.contains("feature"));
assert_eq!(metadata.domain, Domain::FinancialAudit);
}
#[test]
fn test_hypergraph_construction_metadata() {
let kernel = HypergraphConstruction::new();
let metadata = kernel.metadata();
assert!(metadata.id.contains("hypergraph"));
assert_eq!(metadata.domain, Domain::FinancialAudit);
}
}