Commit 16951fa
committed
Make constant memory opt-in, spill large statics to global memory (Rust-GPU#217)
* Allow address spaces to propagate to LLVM
This looks like it was code that wasn't deleted after the refactor in
Rust-GPU@decda87
* Spill large statics from constant to global memory
This isn't fully correct, as ideally we keep track
of what we have put into constant memory and when
it is filled up spill instdead of only spilling when
a static is big. But, this is materially better than
what is there (which is a runtime error).
An argument can be made to just _always_ use global
memory and we don't have to worry about getting the
packing right.
Fixes Rust-GPU#208.
See also the debugging and discussion in
Rust-GPU#216
* Add `--use-constant-memory-space` flag, off by default
* Make it clear that `#[cuda_std::address_space(constant)]` still works1 parent 3e6fd7e commit 16951fa
File tree
3 files changed
+68
-14
lines changed- crates
- cuda_builder/src
- rustc_codegen_nvvm/src
3 files changed
+68
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
133 | 148 | | |
134 | 149 | | |
135 | 150 | | |
| |||
155 | 170 | | |
156 | 171 | | |
157 | 172 | | |
| 173 | + | |
158 | 174 | | |
159 | 175 | | |
160 | 176 | | |
| |||
284 | 300 | | |
285 | 301 | | |
286 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
287 | 321 | | |
288 | 322 | | |
289 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
| 1157 | + | |
1169 | 1158 | | |
1170 | 1159 | | |
1171 | 1160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
270 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
271 | 299 | | |
272 | 300 | | |
273 | 301 | | |
| |||
519 | 547 | | |
520 | 548 | | |
521 | 549 | | |
| 550 | + | |
522 | 551 | | |
523 | 552 | | |
524 | 553 | | |
| |||
537 | 566 | | |
538 | 567 | | |
539 | 568 | | |
| 569 | + | |
| 570 | + | |
540 | 571 | | |
541 | 572 | | |
542 | 573 | | |
| |||
0 commit comments