Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Types | Public Member Functions | Static Public Member Functions
c10::cuda::CUDAStream Class Reference

Public Types

enum  Unchecked { UNCHECKED }
 

Public Member Functions

 CUDAStream (Stream stream)
 Construct a CUDAStream from a Stream. More...
 
 CUDAStream (Unchecked, Stream stream)
 Construct a CUDAStream from a Stream with no error checking. More...
 
bool operator== (const CUDAStream &other) const noexcept
 
bool operator!= (const CUDAStream &other) const noexcept
 
 operator cudaStream_t () const
 Implicit conversion to cudaStream_t.
 
 operator Stream () const
 Implicit conversion to Stream (a.k.a., forget that the stream is a CUDA stream). More...
 
DeviceIndex device_index () const
 Get the CUDA device index that this stream is associated with.
 
Device device () const
 Get the full Device that this stream is associated with. More...
 
StreamId id () const
 Return the stream ID corresponding to this particular stream.
 
bool query () const
 
void synchronize () const
 
int priority () const
 
cudaStream_t stream () const
 Explicit conversion to cudaStream_t.
 
Stream unwrap () const
 Explicit conversion to Stream.
 
uint64_t pack () const noexcept
 Reversibly pack a CUDAStream into a uint64_t representation. More...
 

Static Public Member Functions

static CUDAStream unpack (uint64_t bits)
 
static std::tuple< int, int > priority_range ()
 

Detailed Description

Definition at line 63 of file CUDAStream.h.

Constructor & Destructor Documentation

c10::cuda::CUDAStream::CUDAStream ( Stream  stream)
inlineexplicit

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.

Definition at line 70 of file CUDAStream.h.

c10::cuda::CUDAStream::CUDAStream ( Unchecked  ,
Stream  stream 
)
inlineexplicit

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)

Definition at line 77 of file CUDAStream.h.

Member Function Documentation

Device c10::cuda::CUDAStream::device ( ) const
inline

Get the full Device that this stream is associated with.

The Device is guaranteed to be a CUDA device.

Definition at line 99 of file CUDAStream.h.

c10::cuda::CUDAStream::operator Stream ( ) const
inline

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

Definition at line 92 of file CUDAStream.h.

uint64_t c10::cuda::CUDAStream::pack ( ) const
inlinenoexcept

Reversibly pack a CUDAStream into a uint64_t representation.

This may be helpful when storing a CUDAStream in a C struct, where you cannot conveniently place the CUDAStream object itself (which is morally equivalent, but unfortunately is not POD due to the fact that it has constructors.)

The CUDAStream can be unpacked using unpack(). The format of the uint64_t is unspecified and may be changed.

Definition at line 147 of file CUDAStream.h.


The documentation for this class was generated from the following files: