warp.ScopedMempoolAccess#
- class warp.ScopedMempoolAccess(target_device, peer_device, enable)[source]#
Context manager to temporarily enable or disable mempool access between devices.
Mempool access controls whether
peer_devicecan access allocations from the memory pool oftarget_device. By default, pool allocations are only accessible on the owning device. When enabled, access applies to all allocations from the pool (not just future ones) and is independent of peer access.On context exit, the original access setting is restored.
- Parameters:
target_device (DeviceLike) – The device whose mempool will be accessed.
peer_device (DeviceLike) – The device that will access the target’s mempool.
enable (bool) – Whether to enable (
True) or disable (False) access.
Methods
__init__(target_device, peer_device, enable)