Model Loading & Releasing

hbDNNInitializeFromFiles

int32_t hbDNNInitializeFromFiles(hbDNNPackedHandle_t *dnnPackedHandle,
                                 char const **modelFileNames,
                                 int32_t modelFileCount);

Complete the creation and initialization of dnnPackedHandle from the file. The caller can use the returned dnnPackedHandle across functions and threads.

  • Parameter
    • [out] dnnPackedHandle Horizon DNN handle, pointing to multiple models.
    • [in] modelFileNames Path of the model files.
    • [in] modelFileCount Number of the model files.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.

hbDNNInitializeFromDDR

int32_t hbDNNInitializeFromDDR(hbDNNPackedHandle_t *dnnPackedHandle,
                               const void **modelData, 
                               int32_t *modelDataLengths,
                               int32_t modelDataCount);

Complete the creation and initialization of dnnPackedHandle from the memory. The caller can use the returned dnnPackedHandle across functions and threads.

  • Parameter
    • [out] dnnPackedHandle Horizon DNN handle, pointing to multiple models.
    • [in] modelData Pointer to the model file.
    • [in] modelDataLengths Length of the model data.
    • [in] modelDataCount Number of the model data.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.

hbDNNRelease

int32_t hbDNNRelease(hbDNNPackedHandle_t dnnPackedHandle);

Release the model that dnnPackedHandle points to.

  • Parameter
    • [in] dnnPackedHandle Horizon DNN handle, pointing to multiple models.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.