ImportFromHostPtr#

Fully qualified name: cupva::mem::ImportFromHostPtr

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

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).

This API is available on L4T only, and is not available in safety builds.

Parameters:
  • hostPtr[in] The input host pointer allocated by CPU user code.

  • size[in] Specifies the memory size in byte.

  • access[in] Specifies the access type of the mapped memory.

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

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

  • cupva::Exception(DriverAPIError) – Getting a device pointer failed due to driver API error.

  • cupva::Exception(UnsupportedFeature) – The current platform does not support the feature.

Returns:

The PVA device pointer pointing to the imported memory.