![]() |
NVIDIA DRIVE OS Linux SDK API Reference5.1.12.0 Release |
NvMedia DLA runtime APIs for accessing the DLA hardware engine for deep learning operations.
Modules | |
DLA Specific Types | |
Defines specific types for DLA. | |
Macros | |
#define | NVMEDIA_DLA_VERSION_MAJOR 3 |
Major version number. More... | |
#define | NVMEDIA_DLA_VERSION_MINOR 2 |
Minor version number. More... | |
Functions | |
NvMediaStatus | NvMediaDlaGetVersion (NvMediaVersion *version) |
Returns the version information for the NvMediaDla library. More... | |
NvMediaStatus | NvMediaDlaPingById (const uint32_t dlaId) |
Checks the status of the DLA engine. More... | |
NvMediaDla * | NvMediaDlaCreate (void) |
Creates a default context for NvMediaDla. More... | |
NvMediaStatus | NvMediaDlaDestroy (NvMediaDla *dla) |
Destroys a DLA engine instance created by NvMediaDlaCreate(). More... | |
NvMediaStatus | NvMediaDlaGetUMDVersion (const NvMediaDla *dla, NvMediaDlaUMDVersion *version) |
Returns the version information for the NvMedia DLA UMD library. More... | |
NvMediaStatus | NvMediaDlaGetNumEngines (const NvMediaDla *dla, uint16_t *numEngines) |
Returns the number of DLA hardware engines available. More... | |
NvMediaStatus | NvMediaDlaGetMaxOutstandingTasks (const NvMediaDla *dla, uint32_t *maxOutstandingTasks) |
Returns the maximum number of tasks that can be queued to an instance of an engine. More... | |
NvMediaStatus | NvMediaDlaInit (NvMediaDla *dla, uint32_t dlaId, uint32_t numTasks) |
Configures the context for a particular DLA engine. More... | |
NvMediaStatus | NvMediaDlaGetInstanceId (const NvMediaDla *dla, uint32_t *dlaId) |
Returns the instance id of the NvMediaDla. More... | |
NvMediaStatus | NvMediaDlaGetNumTasks (const NvMediaDla *dla, uint32_t *numTasks) |
Returns the number of outstanding tasks of NvMediaDla. More... | |
NvMediaStatus | NvMediaDlaLoadableCreate (NvMediaDla *dla, NvMediaDlaLoadable **loadable) |
Creates a loadable handle. More... | |
NvMediaStatus | NvMediaDlaLoadableDestroy (const NvMediaDla *dla, NvMediaDlaLoadable *loadable) |
Destroys a loadable handle. More... | |
NvMediaStatus | NvMediaDlaAppendLoadable (const NvMediaDla *dla, const NvMediaDlaBinaryLoadable binaryLoadable, NvMediaDlaLoadable *loadable) |
Appends a loadable to the NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaSetCurrentLoadable (const NvMediaDla *dla, const NvMediaDlaLoadable *loadable) |
Sets the current loadable for the NvMediaDla. More... | |
NvMediaStatus | NvMediaDlaGetNumOfInputTensors (const NvMediaDla *dla, int32_t *numOfInputTensors) |
Gets the number of input tensors for the current loadable in the NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaGetInputTensorDescriptor (const NvMediaDla *dla, const uint32_t idx, NvMediaDlaTensorDescriptor *descriptor) |
Gets the input tensor descriptor for the current loadable in the NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaGetNumOfOutputTensors (const NvMediaDla *dla, int32_t *numOfOutputTensors) |
Gets the number of output tensors for the current loadable in the NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaGetOutputTensorDescriptor (const NvMediaDla *dla, const uint32_t idx, NvMediaDlaTensorDescriptor *descriptor) |
Gets the output tensor descriptor for the current loadable in the NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaDataRegister (const NvMediaDla *dla, const NvMediaDlaData *dlaData, uint32_t flags) |
Registers an NvMediaDlaData for use with an NvMediaDla handle. More... | |
NvMediaStatus | NvMediaDlaDataUnregister (const NvMediaDla *dla, const NvMediaDlaData *dlaData) |
Unregisters an NvMediaDlaData after use. More... | |
NvMediaStatus | NvMediaDlaLoadLoadable (NvMediaDla *dla) |
Loads the current loadable to the provided NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaRemoveLoadable (const NvMediaDla *dla) |
Removes the current loadable from the provided NvMediaDla context. More... | |
NvMediaStatus | NvMediaDlaSubmit (NvMediaDla *dla, const NvMediaDlaArgs *inputArgs, const NvMediaDlaArgs *scratchpadArgs, NvMediaDlaArgs *outputArgs, uint32_t taskTimeout) |
Submits a job to the DLA to run the network on a set of input NvMediaDla arguments and a timeout value. More... | |
NvMediaStatus | NvMediaDlaLoadFromMemory (NvMediaDla *dla, uint8_t *loadable, uint64_t loadableSize, uint16_t dlaId, uint32_t numOutstandingRequests) |
Configures the context for a DLA engine, and loads a pre-compiled network (from memory) for DLA use. More... | |
NvMediaStatus | NvMediaDlaSubmitTimeout (NvMediaDla *dla, const NvMediaDlaArgs *inputArgs, NvMediaDlaArgs *outputArgs, uint32_t taskTimeout) |
Submits a job to the DLA to run the network with a given a set of NvMediaDla input values and a timeout value. More... | |
NvMediaStatus | NvMediaDlaGetMaxOutstandingRequests (const NvMediaDla *dla, uint32_t *maxOutstandingRequests) |
Returns the maximum number of requests that can be queued to an instance of an engine. More... | |
#define NVMEDIA_DLA_VERSION_MAJOR 3 |
Major version number.
Definition at line 47 of file nvmedia_dla.h.
#define NVMEDIA_DLA_VERSION_MINOR 2 |
Minor version number.
Definition at line 49 of file nvmedia_dla.h.
NvMediaStatus NvMediaDlaAppendLoadable | ( | const NvMediaDla * | dla, |
const NvMediaDlaBinaryLoadable | binaryLoadable, | ||
NvMediaDlaLoadable * | loadable | ||
) |
Appends a loadable to the NvMediaDla context.
NvMediaDlaLoadLoadable() appends the value in loadable and returns to the calling function. Currently, only one loadable can be appended.
The application may call this function only once.
[in] | dla | A handle to the DLA context. |
[in] | binaryLoadable | Holds an NvMediaDlaBinaryLoadable. |
[in,out] | loadable | A pointer to the NvMediaDlaLoadable. The loadable will be filled by NvMediaDla. |
NvMediaDla* NvMediaDlaCreate | ( | void | ) |
Creates a default context for NvMediaDla.
Use the function NvMediaDlaLoadFromMemory() to initialize the newly-created context for use as an engine instance.
NvMediaStatus NvMediaDlaDataRegister | ( | const NvMediaDla * | dla, |
const NvMediaDlaData * | dlaData, | ||
uint32_t | flags | ||
) |
Registers an NvMediaDlaData for use with an NvMediaDla handle.
[in] | dla | A handle to the DLA context. |
[in] | dlaData | A pointer to NvMediaDlaData to register. |
[in] | flags | Reserved for future use. |
NvMediaStatus NvMediaDlaDataUnregister | ( | const NvMediaDla * | dla, |
const NvMediaDlaData * | dlaData | ||
) |
Unregisters an NvMediaDlaData after use.
[in] | dla | A handle to the DLA context. |
[in] | dlaData | A pointer to a registered NvMediaDlaData. |
NvMediaStatus NvMediaDlaDestroy | ( | NvMediaDla * | dla | ) |
Destroys a DLA engine instance created by NvMediaDlaCreate().
[in] | dla | A handle to the instance to destroy. |
NvMediaStatus NvMediaDlaGetInputTensorDescriptor | ( | const NvMediaDla * | dla, |
const uint32_t | idx, | ||
NvMediaDlaTensorDescriptor * | descriptor | ||
) |
Gets the input tensor descriptor for the current loadable in the NvMediaDla context.
[in] | dla | A handle to the DLA context. |
[in] | idx | A tensor index. |
[out] | descriptor | Descriptor for the tensor. |
NvMediaStatus NvMediaDlaGetInstanceId | ( | const NvMediaDla * | dla, |
uint32_t * | dlaId | ||
) |
Returns the instance id of the NvMediaDla.
[in] | dla | A handle to the DLA context. |
[in,out] | dlaId | A pointer to the NvMediaDla instance id. |
NvMediaStatus NvMediaDlaGetMaxOutstandingRequests | ( | const NvMediaDla * | dla, |
uint32_t * | maxOutstandingRequests | ||
) |
Returns the maximum number of requests that can be queued to an instance of an engine.
[in] | dla | A handle to the DLA context. |
[out] | maxOutstandingRequests | A pointer to the maximum requests that can be queued. |
NvMediaStatus NvMediaDlaGetMaxOutstandingTasks | ( | const NvMediaDla * | dla, |
uint32_t * | maxOutstandingTasks | ||
) |
Returns the maximum number of tasks that can be queued to an instance of an engine.
[in] | dla | A handle to the DLA context. |
[out] | maxOutstandingTasks | A pointer to the maximum number of tasks that can be queued. |
NvMediaStatus NvMediaDlaGetNumEngines | ( | const NvMediaDla * | dla, |
uint16_t * | numEngines | ||
) |
Returns the number of DLA hardware engines available.
[in] | dla | A handle to the DLA context. |
[out] | numEngines | A pointer to the number of DLA hardware engines. |
NvMediaStatus NvMediaDlaGetNumOfInputTensors | ( | const NvMediaDla * | dla, |
int32_t * | numOfInputTensors | ||
) |
Gets the number of input tensors for the current loadable in the NvMediaDla context.
[in] | dla | A handle to the DLA context. |
[in,out] | numOfInputTensors | The number of input tensors. |
NvMediaStatus NvMediaDlaGetNumOfOutputTensors | ( | const NvMediaDla * | dla, |
int32_t * | numOfOutputTensors | ||
) |
Gets the number of output tensors for the current loadable in the NvMediaDla context.
[in] | dla | A handle to the DLA context. |
[in,out] | numOfOutputTensors | The number of output tensors. |
NvMediaStatus NvMediaDlaGetNumTasks | ( | const NvMediaDla * | dla, |
uint32_t * | numTasks | ||
) |
Returns the number of outstanding tasks of NvMediaDla.
[in] | dla | A handle to the DLA context. |
[in,out] | numTasks | A pointer to the number of outstanding tasks. |
NvMediaStatus NvMediaDlaGetOutputTensorDescriptor | ( | const NvMediaDla * | dla, |
const uint32_t | idx, | ||
NvMediaDlaTensorDescriptor * | descriptor | ||
) |
Gets the output tensor descriptor for the current loadable in the NvMediaDla context.
[in] | dla | A handle to the DLA context. |
[in] | idx | The tensor index. |
[out] | descriptor | A descriptor for the tensor. |
NvMediaStatus NvMediaDlaGetUMDVersion | ( | const NvMediaDla * | dla, |
NvMediaDlaUMDVersion * | version | ||
) |
Returns the version information for the NvMedia DLA UMD library.
[in] | dla | A handle to the DLA context. |
[in] | version | A pointer to an NvMediaDlaUMDVersion structure filled by the NvMediaDla library. |
NvMediaStatus NvMediaDlaGetVersion | ( | NvMediaVersion * | version | ) |
Returns the version information for the NvMediaDla library.
[in] | version | A pointer to an NvMediaVersion structure filled by the NvMediaDla library. |
NvMediaStatus NvMediaDlaInit | ( | NvMediaDla * | dla, |
uint32_t | dlaId, | ||
uint32_t | numTasks | ||
) |
Configures the context for a particular DLA engine.
[in] | dla | A handle to the DLA context. |
[in] | dlaId | The DLA engine ID. Valid range is [0, NvMediaDlaGetNumEngines() - 1]. |
[in] | numTasks | The number of simultaneous tasks that can be submitted to a DLA instance at a time. Valid range is [1, NvMediaDlaGetMaxOutstandingTasks()]. |
NvMediaStatus NvMediaDlaLoadableCreate | ( | NvMediaDla * | dla, |
NvMediaDlaLoadable ** | loadable | ||
) |
Creates a loadable handle.
[in] | dla | A handle to the DLA context. |
[in,out] | loadable | A pointer to the NvMediaDlaLoadable. |
NvMediaStatus NvMediaDlaLoadableDestroy | ( | const NvMediaDla * | dla, |
NvMediaDlaLoadable * | loadable | ||
) |
Destroys a loadable handle.
[in] | dla | A handle to the DLA context. |
[in] | loadable | A pointer to the NvMediaDlaLoadable. |
NvMediaStatus NvMediaDlaLoadFromMemory | ( | NvMediaDla * | dla, |
uint8_t * | loadable, | ||
uint64_t | loadableSize, | ||
uint16_t | dlaId, | ||
uint32_t | numOutstandingRequests | ||
) |
Configures the context for a DLA engine, and loads a pre-compiled network (from memory) for DLA use.
[in] | dla | A handle to the DLA context. |
[in] | loadable | A pointer to an in-memory loadable. |
[in] | loadableSize | Size of the in-memory loadable. |
[in] | dlaId | DLA engine ID. Valid range: [0, NvMediaDlaGetNumEngines() - 1] |
[in] | numOutstandingRequests | Number of outstanding requests. Valid range: [1, NvMediaDlaGetMaxOutstandingRequests()] This determines how many simultaneous requests can be submitted to a DLA instance at a given time. |
NvMediaStatus NvMediaDlaLoadLoadable | ( | NvMediaDla * | dla | ) |
Loads the current loadable to the provided NvMediaDla context.
The loadable can be made current by calling NvMediaDlaSetCurrentLoadable().
[in] | dla | A handle to the DLA device. |
NvMediaStatus NvMediaDlaPingById | ( | const uint32_t | dlaId | ) |
Checks the status of the DLA engine.
This function sends a ping to the DLA engine identified by dlaId to fetch its status.
[in] | dlaId | Id of the DLA engine to ping. |
NvMediaStatus NvMediaDlaRemoveLoadable | ( | const NvMediaDla * | dla | ) |
Removes the current loadable from the provided NvMediaDla context.
The loadable can be made current by calling NvMediaDlaSetCurrentLoadable().
This function must be called after a call to NvMediaDlaLoadLoadable().
[in] | dla | A handle to the DLA context. |
NvMediaStatus NvMediaDlaSetCurrentLoadable | ( | const NvMediaDla * | dla, |
const NvMediaDlaLoadable * | loadable | ||
) |
Sets the current loadable for the NvMediaDla.
[in] | dla | A handle to the DLA context. |
[in] | loadable | A pointer to the NvMediaDlaLoadable. |
NvMediaStatus NvMediaDlaSubmit | ( | NvMediaDla * | dla, |
const NvMediaDlaArgs * | inputArgs, | ||
const NvMediaDlaArgs * | scratchpadArgs, | ||
NvMediaDlaArgs * | outputArgs, | ||
uint32_t | taskTimeout | ||
) |
Submits a job to the DLA to run the network on a set of input NvMediaDla arguments and a timeout value.
[in] | dla | A handle to the DLA context. |
[in] | inputArgs | An pointer to input NvMediaDlaArgs. |
[in] | scratchpadArgs | A pointer to scratchpad arguments for NvMediaDla. |
[in] | outputArgs | Holds output NvMediaDlaArgs. |
[in] | taskTimeout | The maximum time allocated for completing the task (in milliseconds). |
NvMediaStatus NvMediaDlaSubmitTimeout | ( | NvMediaDla * | dla, |
const NvMediaDlaArgs * | inputArgs, | ||
NvMediaDlaArgs * | outputArgs, | ||
uint32_t | taskTimeout | ||
) |
Submits a job to the DLA to run the network with a given a set of NvMediaDla input values and a timeout value.
[in] | dla | A handle to the DLA context. |
[in] | inputArgs | holds input NvMediaDlaArgs values. |
[in] | outputArgs | Holds output NvMediaDlaArgs values. |
[in] | taskTimeout | The maximum time allocated for completing the task (in milliseconds). |