Skip to content

Commit f0690fb

Browse files
committed
modules/cuda: completely revamp microarchitecture handling
Replace the per-CUDA-version architecture lists with a declarative table of support windows (min/max CUDA version per micro-ISA). There's a clean separation between version bounds and logic, and once a new arch like Rubin comes out, it's a table entry instead of a change to complex intertwined logic. User-visible changes: - support the specifiers introduced with CUDA 12.8/12.9: architecture-specific 'X.Ya' ('Hopper(A)', '12.0a', ...) and family-specific 'X.Yf' ('10.0f', ...), plus the Thor and newer Blackwell parts - min_driver_version() table extended through CUDA 13.3 - '+PTX' is now rejected for architecture-specific ('a') targets, which have no forward compatibility - warnings distinguish "CUDA too old for arch" from "arch dropped from CUDA"
1 parent 802e552 commit f0690fb

4 files changed

Lines changed: 343 additions & 250 deletions

File tree

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,8 @@ extend-ignore =
3030
A003
3131
per-file-ignores =
3232
mesonbuild/mesonlib.py:F401,F403
33+
# E131: continuation line unaligned for hanging indent
34+
# E201: whitespace after '('
35+
# (both due to deliberate column alignment in the CUDA arch table)
36+
mesonbuild/modules/cuda.py:E131,E201
3337
max-line-length = 120

docs/markdown/Cuda-module.md

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,36 @@ interpretation is:
7575
The supported architecture names and their corresponding compute capabilities
7676
are:
7777

78-
| Name | Compute Capability |
79-
|-------------------|--------------------|
80-
| `'Fermi'` | 2.0, 2.1(2.0) |
81-
| `'Kepler'` | 3.0, 3.5 |
82-
| `'Kepler+Tegra'` | 3.2 |
83-
| `'Kepler+Tesla'` | 3.7 |
84-
| `'Maxwell'` | 5.0, 5.2 |
85-
| `'Maxwell+Tegra'` | 5.3 |
86-
| `'Pascal'` | 6.0, 6.1 |
87-
| `'Pascal+Tegra'` | 6.2 |
88-
| `'Volta'` | 7.0 |
89-
| `'Xavier'` | 7.2 |
90-
| `'Turing'` | 7.5 |
91-
| `'Ampere'` | 8.0, 8.6 |
78+
| Name | Compute Capability |
79+
|-------------------|----------------------------|
80+
| `'Fermi'` | 2.0, 2.1(2.0) |
81+
| `'Kepler'` | 3.0, 3.5 |
82+
| `'Kepler+Tegra'` | 3.2 |
83+
| `'Kepler+Tesla'` | 3.7 |
84+
| `'Maxwell'` | 5.0, 5.2 |
85+
| `'Maxwell+Tegra'` | 5.3 |
86+
| `'Pascal'` | 6.0, 6.1 |
87+
| `'Pascal+Tegra'` | 6.2 |
88+
| `'Volta'` | 7.0 |
89+
| `'Xavier'` | 7.2 |
90+
| `'Turing'` | 7.5 |
91+
| `'Ampere'` | 8.0, 8.6 |
92+
| `'Orin'` | 8.7 |
93+
| `'Lovelace'` | 8.9 |
94+
| `'Hopper'` | 9.0 |
95+
| `'Hopper(A)'` | 9.0a |
96+
| `'Thor'` | 10.1, 11.0 |
97+
| `'Thor(A)'` | 10.1a, 11.0a |
98+
| `'Blackwell'` | 10.0, 10.3, 12.0, 12.1 |
99+
| `'Blackwell(A)'` | 10.0a, 10.3a, 12.0a, 12.1a |
100+
101+
The `'(A)'` names select the architecture-specific (`a`-suffixed) compute
102+
capabilities of their family. Code built for these can use
103+
architecture-specific features, but runs only on exactly that architecture:
104+
it has no forward compatibility, so it cannot be combined with `+PTX`.
105+
The family-specific `f`-suffixed compute capabilities introduced with
106+
CUDA 12.9 (e.g. `10.0f`, which runs on all later members of the same
107+
family) may be requested explicitly, but are not part of any named set.
92108

93109

94110
Examples:

0 commit comments

Comments
 (0)