diff options
| author | hachem <im@hachem.wtf> | 2026-08-24 14:48:36 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-24 14:48:36 +0200 |
| commit | 24d639224ca11112025289065d7538851606b56e (patch) | |
| tree | e7e26c89cd20099f03ff32727ba0af2cf4762088 /examples/tester/main.rs | |
| parent | 548dc42d9f454cb8c29fddb88ca41f8b1b595882 (diff) | |
[chore]: unwrap project
Diffstat (limited to 'examples/tester/main.rs')
| -rw-r--r-- | examples/tester/main.rs | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/examples/tester/main.rs b/examples/tester/main.rs new file mode 100644 index 0000000..8a9a41c --- /dev/null +++ b/examples/tester/main.rs @@ -0,0 +1,99 @@ +mod benchmarks; +mod clifford; +mod common; +mod custom_gates; +mod kernels; +mod noise; +mod non_clifford; +mod simd; + +use common::{print_benchmark_table, print_summary, BenchmarkResult}; +use std::env; + +fn print_header() { + println!("═══════════════════════════════════════════════════════════════"); + println!(" PSI Quantum Simulator"); + println!("═══════════════════════════════════════════════════════════════\n"); +} + +fn print_usage() { + println!("Usage: tester [OPTIONS]"); + println!(); + println!("Options:"); + println!(" all Run all tests (default)"); + println!(" clifford Run Clifford gate tests only"); + println!(" non-clifford Run non-Clifford gate tests only"); + println!(" custom Run custom gate tests only"); + println!(" kernels Run kernel batching tests only"); + println!(" simd Run SIMD acceleration tests only"); + println!(" noise Run noise channel tests only"); + println!(" bench Run benchmark tests only"); + println!(" help Show this help message"); + println!(); + println!("Examples:"); + println!(" tester # Run all tests"); + println!(" tester clifford # Run only Clifford gate tests"); + println!(" tester non-clifford # Run only rotation/parametric gate tests"); + println!(" tester kernels # Run only kernel batching tests"); + println!(" tester simd # Run only SIMD tests"); + println!(" tester noise # Run only noise channel tests"); + println!(" tester custom bench # Run custom gates and benchmarks"); +} + +fn main() { + let args: Vec<String> = env::args().skip(1).collect(); + + if args + .iter() + .any(|a| a == "help" || a == "--help" || a == "-h") + { + print_usage(); + return; + } + + print_header(); + + let mut results: Vec<BenchmarkResult> = Vec::new(); + + let run_all = args.is_empty() || args.iter().any(|a| a == "all"); + let run_clifford = run_all || args.iter().any(|a| a == "clifford"); + let run_non_clifford = run_all || args.iter().any(|a| a == "non-clifford"); + let run_custom = run_all || args.iter().any(|a| a == "custom"); + let run_kernels = run_all || args.iter().any(|a| a == "kernels"); + let run_simd = run_all || args.iter().any(|a| a == "simd"); + let run_noise = run_all || args.iter().any(|a| a == "noise"); + let run_bench = run_all || args.iter().any(|a| a == "bench"); + + if run_clifford { + clifford::run_all(&mut results); + } + + if run_non_clifford { + non_clifford::run_all(&mut results); + } + + if run_custom { + custom_gates::run_all(&mut results); + } + + if run_kernels { + kernels::run_all(&mut results); + } + + if run_simd { + simd::run_all(&mut results); + } + + if run_noise { + noise::run_all(&mut results); + } + + if run_bench { + benchmarks::run_all(&mut results); + } + + if !results.is_empty() { + print_benchmark_table(&results); + print_summary(&results); + } +} |
