W3cubDocs

/PyTorch 2.9

torch.xpu.synchronize

torch.xpu.synchronize(device=None) [source]

Wait for all kernels in all streams on a XPU device to complete.

Parameters

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

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.xpu.synchronize.html