warp.ScopedPeerAccess#
- class warp.ScopedPeerAccess(target_device, peer_device, enable)[source]#
Context manager to temporarily enable or disable peer access between CUDA devices.
Peer access allows direct memory access between GPUs without going through host memory. When enabled, access applies to all allocations on
target_device(not just future ones).This setting applies to memory allocated using the default CUDA allocator.
On context exit, the original peer access setting is restored.
- Parameters:
target_device (DeviceLike) – The device whose memory will be accessed.
peer_device (DeviceLike) – The device that will access the target’s memory.
enable (bool) – Whether to enable (
True) or disable (False) peer access.
Methods
__init__(target_device, peer_device, enable)