oneflow.cuda.synchronize(device: Optional[Union[oneflow._oneflow_internal.device, str, int]] = None)None

Waits for all kernels in all streams on a CUDA device to complete.


In the eager mode of oneflow, all operations will be converted into instructions executed in the virtual machine, so in order to comply with the semantics of synchronization, this function will call the eager.Sync() function before the device is synchronized, which may affect the operations executed in other devices.


device (flow.device or int, optional) – device for which to synchronize. It uses the current device, given by current_device(), if device is None (default).