CmdBuffer#

Fully qualified name: cupva::CmdBuffer

Defined in src/host/cpp_api/include/cupva_host.hpp

class CmdBuffer : public cupva::DynamicStorage<impl::CmdBuffer>#

CmdBuffer is a container that holds a set of commands.

CmdBuffer allows the user to pack submission data comprised of a list of commands, a status buffer array and submission execution order into a single submittable object. CmdBuffer object is immutable after the creation.

Some properties of CmdProgram instances included in the buffer can be altered prior the submission. The user is allowed to modify parameters via Parameter objects queried from CmdProgram and OffsetPointer instances passed to DataFlow objects.

Public Functions

CmdBuffer() noexcept#

Construct an empty CmdBuffer object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

CmdBuffer(CmdBuffer const&) = delete#
CmdBuffer &operator=(CmdBuffer const&) & = delete#
CmdBuffer(CmdBuffer &&obj) noexcept#

Move construct a CmdBuffer object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

CmdBuffer &operator=(CmdBuffer &&obj) & noexcept#

Move assign a CmdBuffer object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: Yes

    • De-Init: No

void finalize()#

Destroy the resources owned by the object.

This method is exposed to allow fine-grained control over error handling.

During destruction of the object, this method will be called but the destructor must not propagate exceptions. To handle exceptions, manually invoke this method prior to object destruction.

This function can throw exceptions depending on the commands it was created from. See finalize()

exception specification of a particular command for details.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: No

    • De-Init: Yes

Throws:

cupva::Exception(NotAllowedInOperationalState) – if called when NVIDIA DRIVE OS VM state is “Operational”

~CmdBuffer() noexcept#

Destroy the CmdBuffer object.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: No

  • API group

    • Init: No

    • Runtime: No

    • De-Init: Yes

Public Static Functions

static CmdBuffer Create(
BaseCmdList cmdList,
CmdStatus *const status = nullptr,
OrderType const order = IN_ORDER,
)#

Create a CmdBuffer from a variadic pack of commands.

This API creates a CmdBuffer from a variable number of BaseCmd objects known at compile time. The BaseCmd objects must be able to bind to r-value reference i.e. must be moved from, and will be owned by CmdBuffer after creation.

Usage considerations

  • Allowed context for the API call

    • Thread-safe: Yes

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

Parameters:
  • cmdList – A variadic pack of commands

  • status – The pointer to the array of the command status. The array has to be at least as large as the command list.

  • order – The command scheduling mode.

Throws:
  • std::bad_alloc – Allocation of the CmdBuffer object failed.

  • cupva::Exception(NotAllowedInOperationalState) – if called when NVIDIA DRIVE OS VM state is “Operational”

Returns:

CmdBuffer The merged commands.