Shortcuts

Class XPUStream

Page Contents

Class Documentation

class XPUStream

Public Types

enum Unchecked

Values:

enumerator UNCHECKED

Public Functions

inline explicit XPUStream(Stream stream)

Construct a XPUStream from a Stream.

This construction is checked, and will raise an error if the Stream is not, in fact, a XPU stream.

inline explicit XPUStream(Unchecked, Stream stream)

Construct a XPUStream from a Stream with no error checking.

inline bool operator==(const XPUStream &other) const noexcept
inline bool operator!=(const XPUStream &other) const noexcept
inline operator sycl::queue&() const

Implicit conversion to sycl::queue&.

inline operator Stream() const

Implicit conversion to Stream (a.k.a., forget that the stream is a XPU stream).

inline DeviceType device_type() const

Get the XPU device type that this stream is associated with.

inline DeviceIndex device_index() const

Get the XPU device index that this stream is associated with.

inline Device device() const

Get the full Device that this stream is associated with.

The Device is guaranteed to be a XPU device.

inline StreamId id() const

Return the stream ID corresponding to this particular stream.

StreamId is a int64_t representation generated by its type and index.

inline bool query() const

Return true if all enqueued tasks in this stream have been completed, otherwise return false.

inline void synchronize() const

Performs a blocking wait for the completion of all enqueued tasks in this stream.

int priority() const

Return the priority that this stream is associated with.

Lower numbers represent higher priority.

sycl::queue &queue() const

Explicit conversion to sycl::queue&.

inline Stream unwrap() const

Explicit conversion to Stream.

inline struct c10::StreamData3 pack3() const

Reversibly pack a XPUStream into a struct representation.

The XPUStream can be unpacked using unpack3().

Public Static Functions

static inline XPUStream unpack3(StreamId stream_id, DeviceIndex device_index, DeviceType device_type)

Unpack a XPUStream from the 3 fields generated by pack3().

static inline std::tuple<int, int> priority_range()

Return the range of priority supported by PyTorch.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources