Defined in File CUDAStream.h
inline explicit CUDAStream(Stream stream)¶
Construct a CUDAStream from a Stream.
This construction is checked, and will raise an error if the Stream is not, in fact, a CUDA stream.
inline explicit CUDAStream(Unchecked, Stream stream)¶
Construct a CUDAStream from a Stream with no error checking.
This constructor uses the “named” constructor idiom, and can be invoked as: CUDAStream(CUDAStream::UNCHECKED, stream)
inline operator cudaStream_t() const¶
Implicit conversion to cudaStream_t.
inline operator Stream() const¶
Implicit conversion to Stream (a.k.a., forget that the stream is a CUDA stream).
inline DeviceType device_type() const¶
Used to avoid baking in device type explicitly to Python-side API.
inline DeviceIndex device_index() const¶
Get the CUDA 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 CUDA device.
inline StreamId id() const¶
Return the stream ID corresponding to this particular stream.
inline bool query() const¶
inline void synchronize() const¶
inline int priority() const¶
cudaStream_t stream() const¶
Explicit conversion to cudaStream_t.
inline Stream unwrap() const¶
Explicit conversion to Stream.
inline struct c10::StreamData3 pack3() const¶
Reversibly pack a CUDAStream into a struct representation.
Previously the stream’s data was packed into a single int64_t, as it was assumed the fields would not require more than 64 bits of storage in total. See https://github.com/pytorch/pytorch/issues/75854 for more information regarding newer platforms that may violate this assumption.
The CUDAStream can be unpacked using unpack().
- inline explicit CUDAStream(Stream stream)¶