[][src]Struct opencv::core::Stream

pub struct Stream { /* fields omitted */ }

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.

Note: The Stream class is not thread-safe. Please use different Stream objects for different CPU threads.

void thread1()
{
   cv::cuda::Stream stream1;
   cv::cuda::func1(..., stream1);
}
 
void thread2()
{
   cv::cuda::Stream stream2;
   cv::cuda::func2(..., stream2);
}

Note: By default all CUDA routines are launched in Stream::Null() object, if the stream is not specified by user. In multi-threading environment the stream objects must be passed explicitly (see previous note).

Implementations

impl Stream[src]

impl Stream[src]

pub fn default() -> Result<Stream>[src]

creates a new asynchronous stream

pub fn new(allocator: &Ptr<dyn GpuMat_Allocator>) -> Result<Stream>[src]

creates a new asynchronous stream with custom allocator

pub fn null() -> Result<Stream>[src]

return Stream object for default CUDA stream

Trait Implementations

impl Boxed for Stream[src]

impl Drop for Stream[src]

impl Send for Stream[src]

impl StreamTrait for Stream[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.