Renesas GR-PEACH OpenCV Development / gr-peach-opencv-project-sd-card_update

Fork of gr-peach-opencv-project-sd-card by the do

Embed: (wiki syntax)

« Back to documentation index

Stream Class Reference

This class encapsulates a queue of asynchronous calls. More...

#include <cuda.hpp>

Public Member Functions

 Stream ()
 creates a new asynchronous stream
bool queryIfComplete () const
 Returns true if the current stream queue is finished.
void waitForCompletion ()
 Blocks the current CPU thread until all operations in the stream are complete.
void waitEvent (const Event &event)
 Makes a compute stream wait on an event.
void enqueueHostCallback (StreamCallback callback, void *userData)
 Adds a callback to be called on the host after all currently enqueued items in the stream have completed.
 operator bool_type () const
 returns true if stream object is not default (!= 0)

Static Public Member Functions

static StreamNull ()
 return Stream object for default CUDA stream

Detailed Description

This class encapsulates a queue of asynchronous calls.

Note:
Currently, you may face problems if an operation is enqueued twice with different data. Some functions use the constant GPU memory, and next call may update the memory before the previous one has been finished. But calling different operations asynchronously is safe because each operation has its own constant buffer. Memory copy/upload/download/set operations to the buffers you hold are also safe. :

Definition at line 452 of file cuda.hpp.


Constructor & Destructor Documentation

Stream (  )

creates a new asynchronous stream

Stream.

Definition at line 411 of file cuda_stream.cpp.


Member Function Documentation

void enqueueHostCallback ( StreamCallback  callback,
void *  userData 
)

Adds a callback to be called on the host after all currently enqueued items in the stream have completed.

Note:
Callbacks must not make any CUDA API calls. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be serialized.

Definition at line 477 of file cuda_stream.cpp.

cv::cuda::Stream & Null (  ) [static]

return Stream object for default CUDA stream

Definition at line 496 of file cuda_stream.cpp.

operator bool_type (  ) const

returns true if stream object is not default (!= 0)

Definition at line 508 of file cuda_stream.cpp.

bool queryIfComplete (  ) const

Returns true if the current stream queue is finished.

Otherwise, it returns false.

Definition at line 420 of file cuda_stream.cpp.

void waitEvent ( const Event &  event )

Makes a compute stream wait on an event.

Definition at line 445 of file cuda_stream.cpp.

void waitForCompletion (  )

Blocks the current CPU thread until all operations in the stream are complete.

Definition at line 436 of file cuda_stream.cpp.