Files
foxhunt/testing/integration/gpu/mod.rs
jgrusewski c5961cb766 refactor(cuda): remove all #[cfg(not(feature = "cuda"))] dead CPU paths
Delete every CPU fallback block across 14 files (-286 lines):
- dqn.rs: CPU replay buffer, tensor construction, PER fallback, gradient paths
- hyperopt/adapters/ppo.rs: CPU curiosity modules, trajectory generation
- hyperopt/adapters/dqn.rs: CPU backtest fallback, sync no-op
- trainers/ppo.rs: CPU training error stub
- l2_cache.rs: CPU stub functions (gate callers behind cuda too)
- replay_buffer_type.rs: CPU is_gpu_prioritized fallback
- validation/harness.rs: CPU regime breakdown fallback
- build.rs: cpu_only_build cfg (never referenced)
- evaluate_baseline.rs: CPU gpu_handled fallback
- testing/integration/gpu: CPU test stubs

Zero #[cfg(not(feature = "cuda"))] remains in the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 16:26:41 +01:00

51 lines
1.5 KiB
Rust

//! GPU Testing Infrastructure for Foxhunt HFT System
//!
//! This module provides comprehensive GPU testing coverage including:
//! - CUDA device initialization and detection
//! - GPU memory management validation
//! - ML model GPU inference testing
//! - Performance benchmarks (GPU vs CPU)
//! - CUDA kernel validation
//! - Production GPU path testing
pub mod cuda_initialization_test;
pub mod gpu_memory_management_test;
pub mod ml_gpu_inference_test;
pub mod cuda_kernel_test;
pub mod gpu_performance_bench;
pub mod production_gpu_integration_test;
// Re-export commonly used test utilities
/// Common GPU test utilities
pub mod utils {
use std::sync::Once;
static INIT: Once = Once::new();
/// Initialize GPU test environment once per test run
pub fn init_gpu_test_env() {
INIT.call_once(|| {
env_logger::init();
log::info!("🚀 Initializing GPU test environment");
});
}
/// Check if CUDA is available for testing
pub fn cuda_available() -> bool {
cudarc::driver::CudaDevice::new(0).is_ok()
}
/// Get test device (CUDA if available, CPU otherwise)
pub fn get_test_device() -> candle_core::Device {
candle_core::Device::cuda_if_available(0).unwrap_or(candle_core::Device::Cpu)
}
/// Skip test if CUDA not available
pub fn require_cuda() {
if !cuda_available() {
eprintln!("⚠️ Skipping CUDA test - CUDA not available");
std::process::exit(0);
}
}
}