synchronize
- paddle.device. synchronize ( device: PlaceLike | None = None ) None [source]
-
Wait for the compute on the given device to finish.
- Parameters
-
device (str|paddle.CUDAPlace(n)|paddle.XPUPlace(n)|paddle.CustomPlace(n)) – The device which want to wait for. If device is None, the device is the current device. Default: None. It can be
gpu,gpu:x,xpu,xpu:x,custom_device,custom_device:x, wherecustom_deviceis the name of CustomDevice, wherexis the index of the GPUs, XPUs. And it can be paddle.CUDAPlace(n) or paddle.XPUPlace(n) or paddle.CustomPlace(n).
Examples
>>> >>> import paddle >>> paddle.set_device('custom_cpu') >>> paddle.device.synchronize() >>> paddle.device.synchronize("custom_cpu:0") >>> place = paddle.CustomPlace('custom_cpu', 0) >>> paddle.device.synchronize(place)
