Commit d790804
committed
Remove
CUDA C++ has the `__CUDA_ARCH__` macro for conditional compilation.
rust-cuda has a `CUDA_ARCH` environment variable that is similar, and
the `from_cuda_arch_env` method parses the environment variable's value
to produce a value of type `ComputeCapability`, which can be queried for
conditional compilation.
But `ComputeCapability` has a big problem. It's missing all the
capabilities after 80, including the 'a' and 'f' suffix ones. We could
just add them, but it implements `PartialOrd`/`Ord` and uses ordering to
determine feature availability. This was valid before the 'a' and 'f'
suffixes were added but is no longer, because some pairs of values are
incomparable. E.g. `100a` and `101a` -- each one has some features the
other doesn't, so neither is clearly larger than the other, and they're
also not equal.
So, what to do? Well, `CUDA_ARCH` was added in 2022. More recently,
another mechanism for conditional compilation was added:
`target_feature`, in #239. This does work with the 'a' and 'f' suffix
targets, and it's more Rust-y.
So this commit just removes `CUDA_ARCH` and `ComputeCapability`
(removing two more places where the default compilation target is
specified) and changes the only uses (in `cuda_std/src/atomic/mid.rs`)
to use `target_feature` instead. We don't have any tests exercising
conditional compilation, alas, but I did some manual checking locally to
verify that it works the same.ComputeCapability and CUDA_ARCH.1 parent c15d721 commit d790804
6 files changed
+7
-71
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | 812 | | |
816 | 813 | | |
817 | 814 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
22 | | - | |
| 17 | + | |
23 | 18 | | |
24 | 19 | | |
25 | 20 | | |
| |||
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
41 | | - | |
| 36 | + | |
42 | 37 | | |
43 | 38 | | |
44 | 39 | | |
| |||
57 | 52 | | |
58 | 53 | | |
59 | 54 | | |
60 | | - | |
| 55 | + | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
80 | 75 | | |
81 | 76 | | |
82 | 77 | | |
83 | | - | |
| 78 | + | |
84 | 79 | | |
85 | 80 | | |
86 | 81 | | |
| |||
136 | 131 | | |
137 | 132 | | |
138 | 133 | | |
139 | | - | |
| 134 | + | |
140 | 135 | | |
141 | 136 | | |
142 | 137 | | |
| |||
185 | 180 | | |
186 | 181 | | |
187 | 182 | | |
188 | | - | |
| 183 | + | |
189 | 184 | | |
190 | 185 | | |
191 | 186 | | |
| |||
259 | 254 | | |
260 | 255 | | |
261 | 256 | | |
262 | | - | |
| 257 | + | |
263 | 258 | | |
264 | 259 | | |
265 | 260 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 20 | | |
27 | 21 | | |
28 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | 244 | | |
246 | 245 | | |
247 | 246 | | |
| |||
0 commit comments