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>
This commit is contained in:
@@ -97,10 +97,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "cuda"))]
|
||||
{
|
||||
info!("⚠️ CUDA feature not enabled - skipping device properties test");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -342,22 +342,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "cuda"))]
|
||||
#[test]
|
||||
fn test_cuda_feature_disabled() {
|
||||
init_gpu_test_env();
|
||||
info!("⚠️ CUDA feature not enabled - testing graceful handling");
|
||||
|
||||
// Test that the system handles missing CUDA gracefully
|
||||
assert!(!cuda_available(), "CUDA should not be available when feature is disabled");
|
||||
|
||||
// Test that we can still get a CPU device
|
||||
let device = get_test_device();
|
||||
assert!(!device.is_cuda(), "Should fallback to CPU device");
|
||||
|
||||
info!("✅ Graceful CUDA feature disabled handling verified");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cuda_kernel_integration_framework() {
|
||||
init_gpu_test_env();
|
||||
|
||||
@@ -33,14 +33,7 @@ pub mod utils {
|
||||
|
||||
/// Check if CUDA is available for testing
|
||||
pub fn cuda_available() -> bool {
|
||||
#[cfg(feature = "cuda")]
|
||||
{
|
||||
cudarc::driver::CudaDevice::new(0).is_ok()
|
||||
}
|
||||
#[cfg(not(feature = "cuda"))]
|
||||
{
|
||||
false
|
||||
}
|
||||
cudarc::driver::CudaDevice::new(0).is_ok()
|
||||
}
|
||||
|
||||
/// Get test device (CUDA if available, CPU otherwise)
|
||||
|
||||
@@ -403,11 +403,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "cuda"))]
|
||||
{
|
||||
info!("GPU monitoring fallback - CUDA feature not enabled");
|
||||
}
|
||||
|
||||
info!("✅ Production GPU monitoring test completed");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user