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

constexpr cuda_stream_view (cuda_stream_view const &)=default
 
constexpr cuda_stream_view (cuda_stream_view &&)=default
 
constexpr cuda_stream_viewoperator= (cuda_stream_view const &)=default
 
constexpr cuda_stream_viewoperator= (cuda_stream_view &&)=default
 
constexpr cuda_stream_view (int)=delete
 
constexpr cuda_stream_view (std::nullptr_t)=delete
 
constexpr cuda_stream_view (cudaStream_t stream) noexcept
 Implicit conversion from cudaStream_t.
 
constexpr cudaStream_t value () const noexcept
 Get the wrapped stream. More...
 
constexpr operator cudaStream_t () const noexcept
 Implicit conversion to cudaStream_t.
 
bool is_per_thread_default () const noexcept
 Return true if the wrapped stream is the CUDA per-thread default stream.
 
bool is_default () const noexcept
 Return true if the wrapped stream is explicitly the CUDA legacy default stream.
 
void synchronize () 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.

Member Function Documentation

◆ synchronize()

void rmm::cuda_stream_view::synchronize ( ) const
inline

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
inlinenoexcept

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

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

◆ value()

constexpr cudaStream_t rmm::cuda_stream_view::value ( ) const
inlineconstexprnoexcept

Get the wrapped stream.

Returns
cudaStream_t The wrapped stream.

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