Resource#
APIs to create and manage resources used by other cuPVA APIs.
One of the primary resources used by the cuPVA APIs is device pointers. Device pointers represent memory which may be accessed by the PVA’s DMA engine. Device pointers are returned by the cuPVA allocation and mapping APIs.
Device pointers behave like regular pointers in many ways. The user may perform pointer math on device pointers. If the math does not take the pointer out of bounds of the buffer it represents, the resulting pointer will also be a valid device pointer. However, the user may not dereference device pointers. Accessing such addresses will cause a memory fault. To access the corresponding memory on CCPLEX, user may convert the device pointer to a host mapped pointer (valid only for memories accessible by CCPLEX). To access the memory on VPU, user must use the DMA engine. To retrieve a corresponding IOVA for use with cuPVA device APIs, user should assign the device pointer to a parameter.
Classes#
- cupva::Executable
The Executable object holds binaries for execution on the PVA.
Enumerations#
- uint32_t cupva::MemType
Specify the memory types.
- uint32_t cupva::SurfaceFormatType
Enumeration of data storage format.
- uint32_t cupva::mem::AccessType
Specify the host-allocated memory permission.
- uint32_t cupva::mem::AllocType
Specifies the host-memory-allocation type.
- uint32_t cupva::mem::BufferType
Specifies the host-memory-buffer type.
- uint32_t cupva::mem::ExternalAllocType
Specifies the external allocation type.
- uint32_t cupva::mem::L2OperationType
CmdL2Ops operation types.
- uint32_t cupva::mem::L2SRAMPolicyType
L2SRAM mapping policy types.
Functions#
- void cupva::SetVPUPrintBufferSize(uint32_t const size)
Set the size of VPU print buffer for the current context.
- 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.
- void cupva::mem::ConvertToGeometry(cupva::mem::SurfaceAttributes const &attr, int32_t const bpp, PlanarGeometry &geom)
Convert the surface attributes to planar geometry.
- void cupva::mem::Free(void *const devicePtr)
Free the allocated memory.
- void * cupva::mem::GetHostPointer(void *const devicePtr)
Get the host CPU mapped pointer for the given PVA pointer.
- void * cupva::mem::GetL2BaseAddress()
Request a device pointer to the L2SRAM (Orin Only).
- void cupva::mem::GetPointerAttributes(const void *const devicePtr, PointerAttributes &attr)
Query the pointer attributes for the given PVA pointer.
- void cupva::mem::GetSurfaceAttributes(const void *const devicePtr, SurfaceAttributes &attr)
Query the surface attributes for the given PVA pointer.
- void * cupva::mem::ImportFromHostPtr(void *const hostPtr, int64_t const size, AccessType const access=AccessType::READ_WRITE)
Create a PVA pointer from a libc allocated host CPU pointer (L4T only API).
- void * cupva::mem::MapL2(void *devptr, uint32_t size, mem::L2SRAMPolicyType policy=mem::L2SRAMPolicyType::FILL_AND_FLUSH)
Creates a device pointer for an L2SRAM buffer of given size with an optional DRAM buffer backing for persistence and associated cache policy.
- void cupva::mem::Register(const void *const ptr, int64_t const size, cupva::mem::ExternalAllocType const externalAllocType)
Register an external pointer to CUPVA space.
- void cupva::mem::Unregister(const void *const ptr)
Unregisters an external pointer from CUPVA space.
Data Structures#
- cupva::mem::PlaneInfo
Plane info.
- cupva::mem::PointerAttributes
Pointer attributes.
- cupva::mem::SurfaceAttributes
Surface attributes.