The main entry-point to the API is the VPIStream object. More...
Typedefs | |
typedef struct VPIStreamImpl * | VPIStream |
A handle to a stream. | |
Functions | |
VPIStatus | vpiStreamCreateWrapperCUDA (CUstream cudaStream, uint64_t flags, VPIStream *stream) |
Wraps an existing cudaStream_t into a VPI stream. More... | |
VPIStatus | vpiStreamCreate (uint64_t flags, VPIStream *stream) |
Create a stream instance. More... | |
void | vpiStreamDestroy (VPIStream stream) |
Destroy a stream instance and deallocate all HW resources. More... | |
VPIStatus | vpiStreamFlush (VPIStream stream) |
Submits all pending operations for execution. More... | |
VPIStatus | vpiStreamSync (VPIStream stream) |
Blocks the calling thread until all submitted commands in this stream queue are done (queue is empty). More... | |
VPIStatus | vpiStreamWaitEvent (VPIStream stream, VPIEvent event) |
Pushes a command that blocks the processing of all future commands submitted to the stream until the event is signaled. More... | |
VPIStatus | vpiStreamGetThreadHandle (VPIStream stream, VPINativeThreadHandle *handle) |
Returns OS-specific handle of the background stream processing thread. More... | |
VPIStatus | vpiStreamGetFlags (VPIStream stream, uint64_t *flags) |
Gets the VPIStream flags passed during its creation. More... | |
Memory creation flags. | |
These flags can be used when creating images, pyramids or arrays. | |
enum | VPIBackend |
VPI Backend types. More... | |
Stream-specific flags. | |
#define | VPI_STREAM_GREEDY (1ULL << 63) |
Flushes operations to the backend at every submission. | |
The main entry-point to the API is the VPIStream object.
This object represents a command queue (FIFO) storing a list of commands to execute. Commands might comprise running a particular CV algorithm or signaling an event in a particular backend. This allows the API functions to be executed asynchronously with respect to the calling thread. Invoking any CV function simply pushes a corresponding command to the command queue in the VPIStream instance and immediately returns. The queued commands then get consumed and dispatched to the associated backend device.
enum VPIBackend |
#include </opt/nvidia/vpi2/include/vpi/Types.h>
VPI Backend types.
#include </opt/nvidia/vpi2/include/vpi/CUDAInterop.h>
Wraps an existing cudaStream_t
into a VPI stream.
CUDA algorithms are submitted for execution in the wrapped cudaStream_t
. This allows to insert a VPI-driven processing into an existing CUDA pipeline. Algorithms can still be submitted to other backends.
The VPIStream doesn't own the cudaStream_t
. It must be valid during VPIStream lifetime.
CUDA kernels can only be submitted directly to cudaStream_t if it's guaranteed that all tasks submitted to VPIStream are finished.
[in] | cudaStream | The CUDA stream handle to be wrapped.
|
[in] | flags | Bit field specifying the desired characteristics of the stream. VPI_BACKEND_CUDA is always added internally.
|
[out] | stream | Pointer that will receive the newly created VPIStream. |
VPI_ERROR_INVALID_ARGUMENT | Output stream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | Input cudaStream is NULL. |
VPI_ERROR_INVALID_ARGUMENT | No backend were given and VPI_REQUIRE_BACKENDS is set. |
VPI_ERROR_OUT_OF_MEMORY | Not enough resources to create array. |
VPI_ERROR_INVALID_OPERATION | Requested backend isn't enabled in current context. |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_SUCCESS | Operation executed successfully. |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Create a stream instance.
[in] | flags | Bit field specifying the desired characteristics of the stream.
|
[out] | stream | Pointer to memory that will receive the created stream handle. |
VPI_ERROR_INVALID_ARGUMENT | Output stream handle is NULL. |
VPI_ERROR_INVALID_ARGUMENT | flags is invalid. |
VPI_ERROR_INVALID_ARGUMENT | No backend were given and VPI_REQUIRE_BACKENDS is set. |
VPI_ERROR_OUT_OF_MEMORY | Not enough resources to allocate image. |
VPI_ERROR_INVALID_CONTEXT | Current context is destroyed. |
VPI_ERROR_INVALID_OPERATION | Requested backend isn't enabled in current context. |
VPI_SUCCESS | Operation executed successfully. |
void vpiStreamDestroy | ( | VPIStream | stream | ) |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Destroy a stream instance and deallocate all HW resources.
This operation will implicitly synchronize the stream to guarantee that all operations submitted to it are completed.
[in] | stream | Stream handle to be destroyed. Passing NULL is allowed, to which the function simply does nothing. |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Submits all pending operations for execution.
[in] | stream | Stream handle.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL or doesn't represent a VPIStream instance. |
VPI_SUCCESS | Operation executed successfully |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Blocks the calling thread until all submitted commands in this stream queue are done (queue is empty).
This function call is equivalent to atomically calling vpiEventRecord followed by vpiStreamWaitEvent.
The operation will implicitly flush the stream.
[in] | stream | Stream handle.
|
VPI_ERROR_INVALID_ARGUMENT | stream is NULL or doesn't represent a VPIStream instance. |
VPI_SUCCESS | Operation executed successfully |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Pushes a command that blocks the processing of all future commands submitted to the stream until the event is signaled.
[in] | stream | Stream handle.
|
[in] | event | Event handle. |
VPI_ERROR_INVALID_ARGUMENT | Output event is invalid. |
VPI_ERROR_INVALID_ARGUMENT | stream is NULL or doesn't represent a VPIStream instance. |
VPI_SUCCESS | Operation executed successfully |
VPIStatus vpiStreamGetThreadHandle | ( | VPIStream | stream, |
VPINativeThreadHandle * | handle | ||
) |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Returns OS-specific handle of the background stream processing thread.
[in] | stream | Stream handle.
|
[out] | handle | Stream processing thread handle. |
VPI_ERROR_INVALID_ARGUMENT | stream is NULL or doesn't represent a VPIStream instance. |
VPI_ERROR_INVALID_ARGUMENT | Output handle pointer is NULL. |
VPI_SUCCESS | Operation executed successfully. |
#include </opt/nvidia/vpi2/include/vpi/Stream.h>
Gets the VPIStream flags passed during its creation.
[in] | stream | Stream handle.
|
[out] | flags | Pointer to variable where the flags will be stored into. |
VPI_ERROR_INVALID_ARGUMENT | stream is NULL or doesn't represent a VPIStream instance. |
VPI_ERROR_INVALID_ARGUMENT | Output flags pointer is NULL. |
VPI_SUCCESS | Operation executed successfully. |