cuda::experimental::stream
Defined in include/cuda/experimental/__stream/stream.cuh
-
struct stream : public cuda::experimental::stream_ref
An owning wrapper for cudaStream_t.
Public Functions
-
inline explicit stream(device_ref __dev, int __priority = default_priority)
Constructs a stream on a specified device and with specified priority.
Priority is defaulted to stream::default_priority
- Throws
cuda_error – if stream creation fails
-
inline explicit stream(::cuda::experimental::logical_device __dev, int __priority = default_priority)
Constructs a stream on a specified logical device and with specified priority.
Priority is defaulted to stream::default_priority
- Throws
cuda_error – if stream creation fails
-
inline explicit stream(no_init_t) noexcept
Construct a new
stream
object into the moved-from state.- Post
stream()
returns an invalid stream handle
-
inline stream(stream &&__other) noexcept
Move-construct a new
stream
object.- Parameters
__other –
- Post
__other
is in moved-from state.
-
inline ~stream()
Destroy the
stream
object.Note
If the stream fails to be destroyed, the error is silently ignored.
-
inline stream &operator=(stream &&__other) noexcept
Move-assign a
stream
object.- Parameters
__other –
- Post
__other
is in a moved-from state.
-
inline ::cudaStream_t release()
Retrieve the native
cudaStream_t
handle and give up ownership.- Returns
cudaStream_t The native handle being held by the
stream
object.- Post
The stream object is in a moved-from state.
-
inline auto get_scheduler() const noexcept -> stream_ref
Returns a
execution::scheduler
that enqueues work on this stream.
-
inline bool ready() const
Deprecated. Use is_done() instead.
-
inline auto schedule() const noexcept
Returns a
execution::sender
that completes on this stream.Note
Equivalent to
execution::schedule(execution::stream_scheduler{*this})
.
-
inline logical_device logical_device() const
Get the logical device under which this stream was created.
Compared to
device()
member function the returnedlogical_device
will hold a green context for streams created under one.
Public Static Functions
-
static inline stream from_native_handle(::cudaStream_t __handle)
Construct an
stream
object from a nativecudaStream_t
handle.Note
The constructed
stream
object takes ownership of the native handle.- Parameters
__handle – The native handle
- Returns
stream The constructed
stream
object
Public Static Attributes
-
static constexpr int default_priority = 0
-
inline explicit stream(device_ref __dev, int __priority = default_priority)