diff --git a/crates/ml-dqn/src/replay_buffer_type.rs b/crates/ml-dqn/src/replay_buffer_type.rs index 5dd62e5bc..add91833f 100644 --- a/crates/ml-dqn/src/replay_buffer_type.rs +++ b/crates/ml-dqn/src/replay_buffer_type.rs @@ -490,10 +490,13 @@ impl ReplayBufferType { matches!(self, Self::Prioritized(_)) } - /// Check if using GPU-resident prioritized replay - #[cfg(feature = "cuda")] + /// Check if using GPU-resident prioritized replay. + /// Returns false when compiled without `cuda` feature (variant doesn't exist). pub const fn is_gpu_prioritized(&self) -> bool { - matches!(self, Self::GpuPrioritized(_)) + #[cfg(feature = "cuda")] + { matches!(self, Self::GpuPrioritized(_)) } + #[cfg(not(feature = "cuda"))] + { false } } /// Adaptive buffer sizing based on epsilon decay