Public Member Functions | List of all members
rmm::cuda_stream_view Class Reference

Strongly-typed non-owning wrapper for CUDA streams with default constructor. More...

#include <cuda_stream_view.hpp>

Public Member Functions

 cuda_stream_view (cuda_stream_view const &)=default
 Default copy constructor.
 
 cuda_stream_view (cuda_stream_view &&)=default
 Default move constructor.
 
cuda_stream_viewoperator= (cuda_stream_view const &)=default
 Default copy assignment operator. More...
 
cuda_stream_viewoperator= (cuda_stream_view &&)=default
 Default move assignment operator. More...
 
 cuda_stream_view (int)=delete
 
 cuda_stream_view (std::nullptr_t)=delete
 
 cuda_stream_view (cudaStream_t stream) noexcept
 Constructor from a cudaStream_t. More...
 
 cuda_stream_view (cuda::stream_ref stream) noexcept
 Implicit conversion from stream_ref. More...
 
cudaStream_t value () const noexcept
 Get the wrapped stream. More...
 
cudaStream_t get () const noexcept
 Get the wrapped stream. More...
 
 operator cudaStream_t () const noexcept
 Implicit conversion to cudaStream_t. More...
 
 operator cuda::stream_ref () const noexcept
 Implicit conversion to stream_ref. More...
 
bool is_per_thread_default () const noexcept
 true if the wrapped stream is the CUDA per-thread default stream More...
 
bool is_default () const noexcept
 true if the wrapped stream is explicitly the CUDA legacy default stream More...
 
void synchronize () const
 Synchronize the viewed CUDA stream. More...
 
void sync () const
 Synchronize the viewed CUDA stream. More...
 
void synchronize_no_throw () const noexcept
 Synchronize the viewed CUDA stream. Does not throw if there is an error. More...
 

Detailed Description

Strongly-typed non-owning wrapper for CUDA streams with default constructor.

This wrapper is simply a "view": it does not own the lifetime of the stream it wraps.

Constructor & Destructor Documentation

◆ cuda_stream_view() [1/2]

rmm::cuda_stream_view::cuda_stream_view ( cudaStream_t  stream)
noexcept

Constructor from a cudaStream_t.

Parameters
streamThe underlying stream for this view

◆ cuda_stream_view() [2/2]

rmm::cuda_stream_view::cuda_stream_view ( cuda::stream_ref  stream)
noexcept

Implicit conversion from stream_ref.

Parameters
streamThe underlying stream for this view

Member Function Documentation

◆ get()

cudaStream_t rmm::cuda_stream_view::get ( ) const
noexcept

Get the wrapped stream.

Returns
cudaStream_t The underlying stream referenced by this cuda_stream_view

◆ is_default()

bool rmm::cuda_stream_view::is_default ( ) const
noexcept

true if the wrapped stream is explicitly the CUDA legacy default stream

Returns
true if the wrapped stream is explicitly the CUDA legacy default stream

◆ is_per_thread_default()

bool rmm::cuda_stream_view::is_per_thread_default ( ) const
noexcept

true if the wrapped stream is the CUDA per-thread default stream

Returns
true if the wrapped stream is the CUDA per-thread default stream

◆ operator cuda::stream_ref()

rmm::cuda_stream_view::operator cuda::stream_ref ( ) const
noexcept

Implicit conversion to stream_ref.

Returns
stream_ref The underlying stream referenced by this cuda_stream_view

◆ operator cudaStream_t()

rmm::cuda_stream_view::operator cudaStream_t ( ) const
noexcept

Implicit conversion to cudaStream_t.

Returns
cudaStream_t The underlying stream referenced by this cuda_stream_view

◆ operator=() [1/2]

cuda_stream_view& rmm::cuda_stream_view::operator= ( cuda_stream_view &&  )
default

Default move assignment operator.

Returns
cuda_stream_view& Reference to the assigned object

◆ operator=() [2/2]

cuda_stream_view& rmm::cuda_stream_view::operator= ( cuda_stream_view const &  )
default

Default copy assignment operator.

Returns
cuda_stream_view& Reference to the assigned object

◆ sync()

void rmm::cuda_stream_view::sync ( ) const

Synchronize the viewed CUDA stream.

Calls cudaStreamSynchronize().

Exceptions
rmm::cuda_errorif stream synchronization fails

◆ synchronize()

void rmm::cuda_stream_view::synchronize ( ) const

Synchronize the viewed CUDA stream.

Calls cudaStreamSynchronize().

Exceptions
rmm::cuda_errorif stream synchronization fails

◆ synchronize_no_throw()

void rmm::cuda_stream_view::synchronize_no_throw ( ) const
noexcept

Synchronize the viewed CUDA stream. Does not throw if there is an error.

Calls cudaStreamSynchronize() and asserts if there is an error.

◆ value()

cudaStream_t rmm::cuda_stream_view::value ( ) const
noexcept

Get the wrapped stream.

Returns
cudaStream_t The underlying stream referenced by this cuda_stream_view

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