cuda.core._memory._managed_buffer.AccessedBySetProxy#
- class cuda.core._memory._managed_buffer.AccessedBySetProxy(
- buf: ManagedBuffer,
Live driver-backed view of
set_accessed_byadvice for a managed buffer.Reads (
__contains__,__iter__,len(...)) callcuMemRangeGetAttribute; writes (add,discard) callcuMemAdvise. There is no in-memory mirror, so the view always reflects the current driver state.Note
The driver returns integer device ordinals (
-1for host); host NUMA distinctions applied viaHost(numa_id=...)collapse to a genericHost()when iterating this set.Methods
- __init__(
- buf: ManagedBuffer,
- clear()#
This is slow (creates N new iterators!) but effective.
- discard( ) None#
Apply
unset_accessed_byadvice forlocation.Per the
MutableSetcontract,discardis a no-op for elements not in the set.set_accessed_byonly acceptsDeviceand the genericHost()— NUMA-aware host variants (Host(numa_id=...),Host.numa_current()) can never enter the set, so discarding them is silently ignored rather than forwarded to the driver.
- isdisjoint(other)#
Return True if two sets have a null intersection.
- pop()#
Return the popped value. Raise KeyError if empty.
- remove(value)#
Remove an element. If not a member, raise a KeyError.