Commit 9d977be
cuda.core: make managed-prefetch test page-size aware
TestPrefetchBatch.test_per_buffer_location hardcoded a 4096-byte
allocation and assumed two pooled buffers landed on separate physical
pages. Managed-memory prefetch and CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION
operate at page granularity, so on nvidia-64k aarch64 kernels both
4 KB buffers shared one 64 KB page; prefetching buf[1] to the device
migrated the shared page and buf[0]'s host prefetch reported device 0
(assert 0 == -1).
Derive the allocation size from mmap.PAGESIZE so each buffer occupies a
full page on every platform, and add a precondition asserting the two
buffers sit on distinct pages so a pool-packing regression fails loudly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d717605 commit 9d977be
1 file changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
| |||
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
| |||
216 | 231 | | |
217 | 232 | | |
218 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
219 | 238 | | |
220 | 239 | | |
221 | 240 | | |
| |||
0 commit comments