[−][src]Struct opencv::core::Stream
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]
pub fn as_raw_Stream(&self) -> *const c_void
[src]
pub fn as_raw_mut_Stream(&mut self) -> *mut c_void
[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]
pub unsafe fn from_raw(ptr: *mut c_void) -> Self
[src]
pub fn into_raw(self) -> *mut c_void
[src]
pub fn as_raw(&self) -> *const c_void
[src]
pub fn as_raw_mut(&mut self) -> *mut c_void
[src]
impl Drop for Stream
[src]
impl Send for Stream
[src]
impl StreamTrait for Stream
[src]
pub fn as_raw_Stream(&self) -> *const c_void
[src]
pub fn as_raw_mut_Stream(&mut self) -> *mut c_void
[src]
pub fn query_if_complete(&self) -> Result<bool>
[src]
pub fn wait_for_completion(&mut self) -> Result<()>
[src]
pub fn wait_event(&mut self, event: &Event) -> Result<()>
[src]
pub fn enqueue_host_callback(
&mut self,
callback: Stream_StreamCallback
) -> Result<()>
[src]
&mut self,
callback: Stream_StreamCallback
) -> Result<()>
pub fn cuda_ptr(&self) -> Result<*mut c_void>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Stream
[src]
impl !Sync for Stream
[src]
impl Unpin for Stream
[src]
impl UnwindSafe for Stream
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,