Alloc#

Fully qualified name: cupva::mem::Alloc

Defined in src/host/cpp_api/include/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

    • Thread-safe: Yes

  • API group

    • Init: Yes

    • Runtime: No

    • De-Init: No

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.