Stream#

APIs to submit work (CmdProgram) and other commands to the PVA engine.

The cupva::Stream object is the method by which work is submitted to the PVA engine. Streams also allow submission of generic commands for synchronization with the PVA engine.

Classes#

cupva::BaseCmd

BaseCmd is the abstraction of the command passed to hardware.

cupva::BaseCmdList

BaseCmdList is a movable list of BaseCmd instances.

cupva::CmdBuffer

CmdBuffer is a container that holds a set of commands.

cupva::CmdL2Ops

Command to perform L2 memory coherence operations.

cupva::CmdPFSD

Command to submit a permanent fault software diagnostic to a VPU.

cupva::Stream

The Stream is used to submit PVA commands.

Enumerations#

uint32_t cupva::AffinityType

Specifies VPU affinity.

uint32_t cupva::EngineType

Specifies PVA Engine Id.

uint32_t cupva::OrderType

Specifies scheduling and execution order for the commands submitted to the Stream .

Functions#

Error cupva::CheckCommandStatus(CmdStatus const status)

Check the status of a command.

Typedefs#

cupva::CmdStatus

Opaque pointer to status object.

Enumerations#

enum cupva::AffinityType#

Specifies VPU affinity.

Values:

enumerator VPU0#

Specifies VPU0 affinity.

enumerator VPU1#

Specifies VPU1 affinity.

enumerator VPU_ANY#

Specifies VPU ANY affinity. Used to select any available VPU.

enum cupva::EngineType#

Specifies PVA Engine Id.

Values:

enumerator PVA0#

PVA Engine Id 0

enumerator PVA1#

PVA Engine Id 1

enum cupva::OrderType#

Specifies scheduling and execution order for the commands submitted to the Stream.

Commands submitted to the Stream can be scheduled and executed by the hardware in two distinct ways. Commands submitted in IN_ORDER mode (default) will begin and complete the execution in the submission order, i.e., the order they appear in the Stream::submit() call. Commands submitted in OUT_OF_ORDER mode begin execution in submission order, but may complete out of order. Completion ordering in OUT_OF_ORDER mode can be partially or fully enforced via CmdBarrier command which blocks Stream processing until all preceding (in submission order) commands are completed. This is different from CmdWaitOnFences, which blocks subsequent command processing until specific Fence objects are signalled.

OUT_OF_ORDER mode is useful in Stream instances configured to use VPU_ANY affinity, since multiple VPU engines can be used to process multiple independent commands in parallel.

To maximize the execution performance, it is recommended to terminate the submitted command list with a CmdBarrier instance in the following scenarios:

  • Submission has an execution time out specified,

  • Submission includes a CmdProgram instance that uses L2SRAM (Orin-specific),

  • Stream has CUDA interop enabled.

Values:

enumerator IN_ORDER#

The commands in the Stream are scheduled in order.

enumerator OUT_OF_ORDER#

The commands in the Stream are scheduled out of order.

Functions#

Error cupva::CheckCommandStatus(CmdStatus const status)#

Check the status of a command.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

Parameters:

status – A pointer to the command status buffer.

Throws:

cupva::Exception(DriverAPIError) – The PVA driver returned an unexpected error.

Returns:

PvaError The result of checking the status.

Typedefs#

using cupva::CmdStatus = impl::CmdStatus*#

Opaque pointer to status object.