Files
foxhunt/testing/integration/gpu/mod.rs
jgrusewski dd62f3fcfd refactor: eliminate candle from entire workspace — tests, examples, Cargo.toml
Final cleanup:
- 61 test files + 5 example files: candle imports replaced
- 8 testing/integration files: migrated to cudarc/ml-core types
- 3 services/trading_service test files: migrated
- Root Cargo.toml: candle-core, candle-nn removed from [workspace.dependencies]
- crates/ml/Cargo.toml: candle-nn dependency removed
- testing/e2e/Cargo.toml: candle-core dependency removed

Zero active candle_core/candle_nn/candle_optimisers code references remain.
Zero candle dependency declarations in any Cargo.toml.
Remaining "candle" strings are exclusively in doc comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 00:53:47 +01:00

51 lines
1.6 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() -> ml_core::native_types::NativeDevice {
if cudarc::driver::CudaContext::new(0).is_ok() { ml_core::native_types::NativeDevice::Cuda(0) } else { ml_core::native_types::NativeDevice::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);
}
}
}