current_stream

paddle.device.cuda. current_stream ( device=None ) [source]

Return the current CUDA stream by the device.

Parameters

device (paddle.CUDAPlace()|int, optional) – The device or the ID of the device which want to get stream from. If device is None, the device is the current device. Default: None.

Returns

the stream to the device.

Return type

CUDAStream

Examples

# required: gpu
import paddle

s1 = paddle.device.cuda.current_stream()

s2 = paddle.device.cuda.current_stream(0)

s3 = paddle.device.cuda.current_stream(paddle.CUDAPlace(0))