[PATCH v1 4/7] gpu: nova-core: add Architecture::is_pre_hopper() helper

From: Joel Fernandes

Date: Fri May 01 2026 - 16:58:57 EST


Add a helper method to the Architecture enum that returns true for Turing,
Ampere, and Ada -- the GPU generations that predate Hopper.

The interrupt controller uses this to determine the number of active
interrupt leaves at construction time.

Signed-off-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>
---
drivers/gpu/nova-core/gpu.rs | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs
index 3ac9cb106bfd..3b45bce6738b 100644
--- a/drivers/gpu/nova-core/gpu.rs
+++ b/drivers/gpu/nova-core/gpu.rs
@@ -163,6 +163,13 @@ pub(crate) enum Architecture with TryFrom<Bounded<u32, 6>> {
}
}

+impl Architecture {
+ /// Returns `true` for GPU architectures that predate Hopper.
+ pub(crate) fn is_pre_hopper(self) -> bool {
+ matches!(self, Self::Turing | Self::Ampere | Self::Ada)
+ }
+}
+
#[derive(Clone, Copy)]
pub(crate) struct Revision {
major: Bounded<u8, 4>,
--
2.34.1