Commit 47d2358
committed
fix(cuda.core): make AccessedBySetProxy.discard a no-op on NUMA-host inputs
`MutableSet.discard(x)` is contractually a no-op when `x` is not in the
set. `set_accessed_by` only accepts `device` and generic `host` kinds, so
NUMA-aware host variants (`Host(numa_id=...)`, `Host.numa_current()`)
can never enter the set — they are necessarily non-members.
Previously, `discard` forwarded such inputs to `_advise_one`, which
raised `ValueError` from the kind-allowed check. That broke the
`MutableSet` contract that `AccessedBySetProxy` claims by inheriting
from `MutableSet`, and caused `test_accessed_by_mutable_set_interface`
to fail on the helper's non-member sentinel.
Add an explicit short-circuit for the NUMA-host kinds.
Fixes CI failure for tests/memory/test_managed_ops.py::TestManagedBuffer::test_accessed_by_mutable_set_interface.1 parent be46eed commit 47d2358
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
107 | 114 | | |
108 | 115 | | |
| 116 | + | |
| 117 | + | |
109 | 118 | | |
110 | 119 | | |
111 | 120 | | |
| |||
0 commit comments