Commit a933a88
Fix Buffer.is_managed to merge driver and resource signals
Previous fix unconditionally delegated Buffer.is_managed to
_memory_resource.is_managed, which returns False for any
MemoryResource subclass that does not opt in. That broke
DummyUnifiedMemoryResource (and any user-defined MR wrapping
cuMemAllocManaged) where the driver pointer attribute correctly
reports IS_MANAGED=1 but the resource does not override is_managed.
Query the driver first; only fall back to the memory resource when
the driver does not report IS_MANAGED (the pool-allocated managed
memory path). This keeps both old-style cuMemAllocManaged buffers
and ManagedMemoryResource pool allocations correctly classified.
Also rework the regression test parametrization to skip the pinned
case when PinnedMemoryResource is unavailable (CUDA < 13.0), and pick
up the ruff-format reflow of the helper call site.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 27b309f commit a933a88
2 files changed
+15
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
394 | | - | |
395 | 393 | | |
396 | | - | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
620 | | - | |
621 | | - | |
622 | | - | |
| 620 | + | |
623 | 621 | | |
624 | 622 | | |
625 | 623 | | |
| |||
630 | 628 | | |
631 | 629 | | |
632 | 630 | | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
| 631 | + | |
| 632 | + | |
641 | 633 | | |
642 | 634 | | |
643 | 635 | | |
644 | 636 | | |
645 | 637 | | |
646 | | - | |
647 | | - | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
648 | 644 | | |
649 | | - | |
| 645 | + | |
650 | 646 | | |
651 | 647 | | |
652 | 648 | | |
| |||
0 commit comments