9 #include <rmm/detail/export.hpp>
11 #include <cuda/stream_ref>
12 #include <cuda_runtime_api.h>
17 namespace RMM_EXPORT
rmm {
34 enum class flags : unsigned int {
35 sync_default = cudaStreamDefault,
37 cudaStreamNonBlocking,
81 [[nodiscard]] cudaStream_t
value()
const;
86 explicit operator cudaStream_t() const noexcept;
107 operator cuda::stream_ref() const noexcept;
116 void synchronize() const;
123 void synchronize_no_throw() const noexcept;
126 std::unique_ptr<cudaStream_t, std::function<
void(cudaStream_t*)>> stream_;
Strongly-typed non-owning wrapper for CUDA streams with default constructor.
Definition: cuda_stream_view.hpp:28
Owning wrapper for a CUDA stream.
Definition: cuda_stream.hpp:29
bool is_valid() const
Returns true if the owned stream is non-null.
cuda_stream & operator=(cuda_stream &&)=default
Move copy assignment operator (default)
cudaStream_t value() const
Get the value of the wrapped CUDA stream.
flags
stream creation flags.
Definition: cuda_stream.hpp:34
cuda_stream(cuda_stream &&)=default
Move constructor (default)
cuda_stream(cuda_stream::flags flags=cuda_stream::flags::sync_default)
Construct a new CUDA stream object.
RAPIDS Memory Manager - The top-level namespace for all RMM functionality.