Commit e0c782a
test(cuda.core): query all buffers before closing in test_batched_same_advice
On CUDA 12, freeing one managed allocation appears to clear the
read-mostly advice on neighboring ranges. The original test interleaved
query-then-close inside one loop, so the second iteration would query
bufs[1] *after* bufs[0] had been freed and observe a cleared advice
flag — causing assert 0 == 1.
Move the queries into a list comprehension that runs before any close,
then close all buffers, then assert. Decouples the verification from
the deallocation order.
CUDA 13 was unaffected because its managed-memory bookkeeping does not
exhibit the cross-range invalidation on free.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0789bf6 commit e0c782a
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2245 | 2245 | | |
2246 | 2246 | | |
2247 | 2247 | | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
2255 | 2256 | | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
2256 | 2260 | | |
| 2261 | + | |
| 2262 | + | |
2257 | 2263 | | |
2258 | 2264 | | |
2259 | 2265 | | |
| |||
0 commit comments