warp.stream_to_torch#

warp.stream_to_torch(stream_or_device=None)[source]#

Convert from a Warp CUDA stream to a Torch CUDA stream.

Streams created using warp.Stream() are blocking and the returned PyTorch ExternalStream inherits that behavior. This means PyTorch operations on the returned stream will implicitly synchronize with the CUDA default stream, matching the default Warp behavior. See Blocking and Non-Blocking Streams for background on blocking vs. non-blocking streams.