warp.stream_from_torch#

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

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

Streams created using torch.cuda.Stream() are non-blocking and the returned warp.Stream inherits that behavior. When using those streams to run Warp operations, ensure that Warp-owned resources are not garbage-collected while work on the non-blocking stream is still pending. See Blocking and Non-Blocking Streams for details and mitigation strategies.