Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Public Member Functions | Friends | List of all members
uni20::cuda::Stream Class Reference

Reference-counted lease of one CUDA stream-pool slot. More...

#include <runtime.hpp>

Classes

class  State
 

Public Member Functions

int device () const noexcept
 Return the device that owns this stream.
 
cudaStream_t native_handle () const noexcept
 Return the CUDA runtime stream handle.
 
 operator bool () const noexcept
 Return whether this handle refers to a leased CUDA stream.
 
Stream & operator= (Stream &&other) noexcept=default
 
Stream & operator= (Stream const &) noexcept=default
 
Completion record_completion () const
 Record and return an immutable completion for the current stream tail.
 
 Stream ()=default
 
 Stream (Stream &&other) noexcept=default
 
 Stream (Stream const &) noexcept=default
 
void synchronize () const
 Wait on all work currently queued in this stream.
 
void wait_on (Completion const &completion) const
 Make this stream wait for completion before executing subsequent work.
 
 ~Stream ()=default
 

Friends

class StreamPool
 

Detailed Description

Reference-counted lease of one CUDA stream-pool slot.

Streams are acquired from StreamPool. Copies share the same lease; the stream is returned to the pool only after the last reference is destroyed and all queued CUDA work has completed.

Constructor & Destructor Documentation

◆ Stream() [1/3]

uni20::cuda::Stream::Stream ( )
default

◆ Stream() [2/3]

uni20::cuda::Stream::Stream ( Stream const &  )
defaultnoexcept

◆ Stream() [3/3]

uni20::cuda::Stream::Stream ( Stream &&  other)
defaultnoexcept

◆ ~Stream()

uni20::cuda::Stream::~Stream ( )
default

Member Function Documentation

◆ device()

int uni20::cuda::Stream::device ( ) const
noexcept

Return the device that owns this stream.

◆ native_handle()

cudaStream_t uni20::cuda::Stream::native_handle ( ) const
noexcept

Return the CUDA runtime stream handle.

◆ operator bool()

uni20::cuda::Stream::operator bool ( ) const
inlineexplicitnoexcept

Return whether this handle refers to a leased CUDA stream.

◆ operator=() [1/2]

Stream & uni20::cuda::Stream::operator= ( Stream &&  other)
defaultnoexcept

◆ operator=() [2/2]

Stream & uni20::cuda::Stream::operator= ( Stream const &  )
defaultnoexcept

◆ record_completion()

Completion uni20::cuda::Stream::record_completion ( ) const

Record and return an immutable completion for the current stream tail.

◆ synchronize()

void uni20::cuda::Stream::synchronize ( ) const

Wait on all work currently queued in this stream.

◆ wait_on()

void uni20::cuda::Stream::wait_on ( Completion const &  completion) const

Make this stream wait for completion before executing subsequent work.

The producer completion may belong to a different CUDA device.

Friends And Related Symbol Documentation

◆ StreamPool

friend class StreamPool
friend

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