@Namespace(value="cv::cuda")
@NoOffset
public static class opencv_core.Stream
extends org.bytedeco.javacpp.Pointer
\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).
| Modifier and Type | Class and Description |
|---|---|
static class |
opencv_core.Stream.Impl
returns true if stream object is not default (!= 0)
|
static class |
opencv_core.Stream.StreamCallback |
| Constructor and Description |
|---|
Stream()
creates a new asynchronous stream
|
Stream(long size)
Native array allocator.
|
Stream(opencv_core.GpuMat.Allocator allocator)
creates a new asynchronous stream with custom allocator
|
Stream(org.bytedeco.javacpp.Pointer p)
Pointer cast constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enqueueHostCallback(opencv_core.Stream.StreamCallback callback,
org.bytedeco.javacpp.Pointer userData)
\brief Adds a callback to be called on the host after all currently enqueued items in the stream have
completed.
|
static opencv_core.Stream |
Null()
return Stream object for default CUDA stream
|
opencv_core.Stream |
position(long position) |
boolean |
queryIfComplete()
\brief Returns true if the current stream queue is finished.
|
void |
waitEvent(opencv_core.Event event)
\brief Makes a compute stream wait on an event.
|
void |
waitForCompletion()
\brief Blocks the current CPU thread until all operations in the stream are complete.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic Stream(org.bytedeco.javacpp.Pointer p)
Pointer.Pointer(Pointer).public Stream(long size)
Pointer.position(long).public Stream()
public Stream(@opencv_core.Ptr opencv_core.GpuMat.Allocator allocator)
public opencv_core.Stream position(long position)
position in class org.bytedeco.javacpp.Pointer@Cast(value="bool") public boolean queryIfComplete()
public void waitForCompletion()
public void waitEvent(@Const @ByRef
opencv_core.Event event)
public void enqueueHostCallback(opencv_core.Stream.StreamCallback callback, org.bytedeco.javacpp.Pointer userData)
\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.
@ByRef public static opencv_core.Stream Null()
Copyright © 2018. All rights reserved.