Back to Pytorch

XPU Streams

docs/cpp/source/api/xpu/streams.md

2.12.0905 B
Original Source

XPU Streams

XPU streams provide a mechanism for asynchronous execution of operations on Intel GPUs. Like CUDA streams, operations queued to the same stream execute in order, while operations on different streams can execute concurrently.

XPUStream

{doxygenclass}
:members:
:undoc-members:

Example:

cpp
#include <c10/xpu/XPUStream.h>

// Get the current XPU stream
auto stream = c10::xpu::getCurrentXPUStream();

// Create a new stream from the pool
auto new_stream = c10::xpu::getStreamFromPool();

// Synchronize
stream.synchronize();

Acquiring XPU Streams

{doxygenfunction}
{doxygenfunction}
{doxygenfunction}

Stream Synchronization

{doxygenfunction}