Alloc#

Fully qualified name: cupva::mem::Alloc

Defined in cupva_host.hpp

void *cupva::mem::Alloc(
int64_t const size,
AccessType const accessType = AccessType::READ_WRITE,
AllocType const allocType = AllocType::ALLOC_DRAM,
)#

Allocate memory that is accessible by PVA engine.

Usage considerations

  • Allowed context for the API call

    • Interrupt handler: No

    • Signal handler: No

    • Thread-safe: Yes

    • Re-entrant: No

    • Async/Sync: Sync

  • Required privileges: None

  • Allowed execution state

    • Initialization: Yes

    • Operational: No

    • Reinit/Deinit Preparation: Yes

  • Maturity: GA

Parameters:
  • size – [in] The required memory size in byte.

  • accessType – [in] Specifies the access type of the allocated memory.

  • allocType – [in] Specifies the allocating memory type

Throws:
  • cupva::Exception(InvalidArgument) – Allocation size or access type is invalid.

  • cupva::Exception(InternalError) – VA allocation failed.

  • cupva::Exception(DriverAPIError) – Allocation failed due to driver API error.

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

  • cupva::Exception(InvalidArgument) – if accessType is not READ_WRITE

Returns:

The device pointer pointing to the allocated memory.

Pre:

None