Commit 93f3880
Add tests for ObjectCode.from_fatbin() using nvfatbin bindings (#1875)
* Add tests for ObjectCode.from_fatbin() using nvfatbin bindings
Add availability detection for nvfatbin bindings and tests for loading
fatbin code both from memory (bytes) and from file (str path). The fatbin
fixture creates a multi-arch fatbin containing a cubin for the current
device arch and PTX for a second arch, exercising the nvfatbin API
(create, add_cubin, add_ptx, size, get, destroy).
Partially addresses #663.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix fatbin fixture: compile PTX targeting second_arch
The PTX was being compiled for the current device's arch but labeled
as a different arch in nvfatbin, which could produce an invalid fatbin.
Now compile PTX with ProgramOptions(arch=f"sm_{second_arch}") so the
PTX actually targets the intended architecture.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Make cubin compilation arch explicit in fatbin fixture
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* [pre-commit.ci] auto code formatting
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent da79d63 commit 93f3880
1 file changed
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| |||
90 | 104 | | |
91 | 105 | | |
92 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
93 | 145 | | |
94 | 146 | | |
95 | 147 | | |
| |||
220 | 272 | | |
221 | 273 | | |
222 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
223 | 297 | | |
224 | 298 | | |
225 | 299 | | |
| |||
0 commit comments