Expand description
Performance benchmarks comparing CPU, wgpu, and CUDA backends.
This module measures throughput for the core compute kernels (SPH density, LBM collision, parallel scan) across available backends and reports wall-clock timing and effective GFLOP/s estimates.
§Quick usage
use oxiphysics_gpu::gpu_bench::{GpuBenchHarness, BackendKind};
let mut h = GpuBenchHarness::new();
// Benchmark SPH density summation for 256 particles
let reports = h.bench_sph_density(256);
for r in &reports {
println!("{}", r);
}
// Compare available backends
let available = GpuBenchHarness::available_backends();
assert!(available.contains(&BackendKind::Cpu));Structs§
- Cuda
Speedup Report - Computed speedup between a CPU and a CUDA benchmark report.
- GpuBench
Harness - Timing harness for GPU/CPU backend comparison benchmarks.
- GpuBench
Report - Result of a single GPU benchmark run.
- Speedup
Report - Computed speedup between a CPU and a wgpu benchmark report.
Enums§
- Backend
Kind - Identifies a compute backend for benchmark reporting.
Functions§
- compute_
cuda_ speedup - Compute a speedup ratio from a pair of bench reports produced by
GpuBenchHarness::cpu_vs_cuda_sph. - compute_
speedup - Compute a speedup ratio from a pair of bench reports.
- inclusive_
scan_ cpu - Sequential inclusive prefix scan (Σ) on
f64elements.