OpenCV  3.0.0
Open Source Computer Vision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
cv::cuda::Stream Class Reference

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

#include "cuda.hpp"

Public Types

typedef void(* StreamCallback )(int status, void *userData)
 

Public Member Functions

 Stream ()
 creates a new asynchronous stream More...
 
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. More...
 
 operator bool_type () const
 returns true if stream object is not default (!= 0) More...
 
bool queryIfComplete () const
 Returns true if the current stream queue is finished. Otherwise, it returns false. More...
 
void waitEvent (const Event &event)
 Makes a compute stream wait on an event. More...
 
void waitForCompletion ()
 Blocks the current CPU thread until all operations in the stream are complete. More...
 

Static Public Member Functions

static StreamNull ()
 return Stream object for default CUDA stream More...
 

Friends

class BufferPool
 
class DefaultDeviceInitializer
 
struct StreamAccessor
 

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. :

Member Typedef Documentation

typedef void(* cv::cuda::Stream::StreamCallback)(int status, void *userData)

Constructor & Destructor Documentation

cv::cuda::Stream::Stream ( )

creates a new asynchronous stream

Member Function Documentation

void cv::cuda::Stream::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.
static Stream& cv::cuda::Stream::Null ( )
static

return Stream object for default CUDA stream

cv::cuda::Stream::operator bool_type ( ) const

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

bool cv::cuda::Stream::queryIfComplete ( ) const

Returns true if the current stream queue is finished. Otherwise, it returns false.

void cv::cuda::Stream::waitEvent ( const Event event)

Makes a compute stream wait on an event.

void cv::cuda::Stream::waitForCompletion ( )

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

Friends And Related Function Documentation

friend class BufferPool
friend
friend class DefaultDeviceInitializer
friend
friend struct StreamAccessor
friend

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