Skip to main content

Module p2p

Module p2p 

Source
Expand description

P2P (peer-to-peer) topology + cross-device async memcpy.

cudarc 0.19 exposes peer access only at the sys layer: cuDeviceCanAccessPeer, cuCtxEnablePeerAccess, cuMemcpyPeerAsync. This module wraps those with explicit unsafe blocks behind an actor surface.

Lifecycle:

  1. Construct with N ActorRef<DeviceMsg> siblings.
  2. Send EnableAll — actor snapshots each device’s Arc<CudaContext>, probes cuDeviceCanAccessPeer for every pair, calls cuCtxEnablePeerAccess on directions that succeed, and replies with the resulting P2pGraph.
  3. Send CopyF32 { src, src_device, dst, dst_device } — actor issues cuMemcpyPeerAsync on a fresh destination-side stream and replies after cudaStreamSynchronize.

Structs§

P2pGraph
P2pTopology

Enums§

P2pMsg