docs/classtf_1_1cudaStreamBase.html
class to create a CUDA stream with unique ownership
| Template parameters |
|---|
| Creator |
| Deleter |
The cudaStream class encapsulates a cudaStream_t using std::unique_ptr, ensuring that CUDA events are properly created and destroyed with a unique ownership.
using base_type = std::unique_ptr<std::remove_pointer_t<cudaStream_t>, Deleter> base type for the underlying unique pointer
template<typename... ArgsT>
cudaStreamBase(ArgsT && ... args) explicit constructs a cudaStream object by passing the given arguments to the stream creatorcudaStreamBase(cudaStreamBase&&) defaultedconstructs a cudaStream from the given rhs using move semantics
auto operator=(cudaStreamBase&&) -> cudaStreamBase& defaultedassign the rhs to *this using move semanticsauto synchronize() -> cudaStreamBase&synchronizes the associated streamvoid begin_capture(cudaStreamCaptureMode m = cudaStreamCaptureModeGlobal) constbegins graph capturing on the streamauto end_capture() const -> cudaGraph_tends graph capturing on the streamvoid record(cudaEvent_t event) constrecords an event on the streamvoid wait(cudaEvent_t event) constwaits on an event
template<typename C, typename D>
auto run(const cudaGraphExecBase<C, D>& exec) -> cudaStreamBase&runs the given executable CUDA graphauto run(cudaGraphExec_t exec) -> cudaStreamBase&runs the given executable CUDA graph
base type for the underlying unique pointer
This alias provides a shorthand for the underlying std::unique_ptr type that manages CUDA stream resources with an associated deleter.
constructs a cudaStream object by passing the given arguments to the stream creator
| Parameters |
|---|
| args |
Constructs a cudaStream object by passing the given arguments to the stream creator
synchronizes the associated stream
Equivalently calling cudaStreamSynchronize to block until this stream has completed all operations.
begins graph capturing on the stream
When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into a graph, which will be returned via cudaStream::end_capture.
A thread's mode can be one of the following:
cudaStreamCaptureModeGlobal: This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with cudaStreamCaptureModeRelaxed at cuStreamBeginCapture, or if any other thread has a concurrent capture sequence initiated with cudaStreamCaptureModeGlobal, this thread is prohibited from potentially unsafe API calls.cudaStreamCaptureModeThreadLocal: If the local thread has an ongoing capture sequence not initiated with cudaStreamCaptureModeRelaxed, it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.cudaStreamCaptureModeRelaxed: The local thread is not prohibited from potentially unsafe API calls. Note that the thread is still prohibited from API calls which necessarily conflict with stream capture, for example, attempting cudaEventQuery on an event that was last recorded inside a capture sequence.ends graph capturing on the stream
Equivalently calling cudaStreamEndCapture to end capture on stream and returning the captured graph. Capture must have been initiated on stream via a call to cudaStream::begin_capture. If capture was invalidated, due to a violation of the rules of stream capture, then a NULL graph will be returned.
records an event on the stream
Equivalently calling cudaEventRecord to record an event on this stream, both of which must be on the same CUDA context.
waits on an event
Equivalently calling cudaStreamWaitEvent to make all future work submitted to stream wait for all work captured in event.
runs the given executable CUDA graph
| Parameters |
|---|
| exec |
runs the given executable CUDA graph
| Parameters |
|---|
| exec |