Model Info
hbDNNGetModelNameList
Get the name list and number of the models that dnnPackedHandle points to.
- Parameter
- [out]
modelNameListList of model names. - [out]
modelNameCountNumber of model names. - [in]
dnnPackedHandleHorizon DNN handle, pointing to multiple models.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetModelHandle
Get the handle of a model from the model list that dnnPackedHandle points to. The caller can use the returned dnnHandle across functions and threads.
- Parameter
- [out]
dnnHandleDNN handle, pointing to one model. - [in]
dnnPackedHandleDNN handle, pointing to multiple models. - [in]
modelNameModel name.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetInputCount
Get the number of the input tensors of the model that dnnHandle points to.
- Parameter
- [out]
inputCountNumber of input tensors of the model. - [in]
dnnHandleDNN handle, pointing to one model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetInputName
Get the name of the input tensors of the model that dnnHandle points to.
- Parameter
- [out]
nameName of the input tensor of the model. - [in]
dnnHandleDNN handle, pointing to one model. - [in]
inputIndexIndex of the input tensor of the model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetInputTensorProperties
Get the property of the specific input tensor of the model that dnnHandle points to.
- Parameter
- [out]
propertiesInfo of the input tensor. - [in]
dnnHandleDNN handle, pointing to one model. - [in]
inputIndexIndex of the input tensor of the model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetOutputCount
Get the number of the output tensors of the model that dnnHandle points to.
- Parameter
- [out]
outputCountNumber of the output tensors of the model. - [in]
dnnHandleDNN handle, pointing to one model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetOutputName
Get the names of the output tensors of the model that dnnHandle points to.
- Parameter
- [out]
nameName of the output tensor of the model. - [in]
dnnHandleDNN handle, pointing to one model. - [in]
outputIndexIndex of the output tensor of the model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetOutputTensorProperties
Get the property of the specific output tensor of the model that dnnHandle points to.
- Parameter
- [out]
propertiesInfo of the output tensor. - [in]
dnnHandleDNN handle, pointing to one model. - [in]
outputIndexIndex of the output tensor of the model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetInputDesc
Get the description information associated with the specific input of the model that dnnHandle points to.
- Parameter
- [out]
descAddress of the description information. - [out]
sizeSize of the description information. - [out]
typeType of the description information, please refer to hbDNNDescType. - [in]
dnnHandleDNN handle, pointing to one model. - [in]
inputIndexIndex of the input tensor of the model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetOutputDesc
Get the description information associated with the specific output of the model that dnnHandle points to.
- Parameter
- [out]
descAddress of the description information. - [out]
sizeSize of the description information. - [out]
typeType of the description information, please refer to hbDNNDescType. - [in]
dnnHandleDNN handle, pointing to one model. - [in]
outputIndexIndex of the output tensor of the model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetModelDesc
Get the description information associated with the model that dnnHandle points to.
- Parameter
- [out]
descAddress of the description information. - [out]
sizeSize of the description information. - [out]
typeType of the description information, please refer to hbDNNDescType. - [in]
dnnHandleDNN handle, pointing to one model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNGetCompileBpuCoreNum
Get the number of BPU cores at compile time associated with the model that dnnHandle points to.
- Parameter
- [out]
bpuCoreNumThe number of BPU cores at compile time. - [in]
dnnHandleDNN handle, pointing to one model.
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
When the obtained bpuCoreNum value is greater than 1, the model is a multi-core model.
When calling hbUCPSubmitTask to submit a multi-core model task, ensure that the number of BPU cores in the control parameter hbUCPSchedParam.backend is exactly equal to bpuCoreNum obtained through this interface. Setting HB_UCP_CORE_ANY or HB_UCP_BPU_CORE_ANY is not allowed.
For example, when the obtained bpuCoreNum value is 2, you need to set hbUCPSchedParam.backend = HB_UCP_BPU_CORE_0 | HB_UCP_BPU_CORE_1. This setting method is understood as running the model on HB_UCP_BPU_CORE_0 and HB_UCP_BPU_CORE_1. Note that this is different from the setting method of selecting two backends during single-core model inference.
hbDNNGetHBMDesc
Get the description information associated with the hbm that dnnPackedHandle and index points to.
- Parameter
- [out]
descAddress of the description information. - [out]
sizeSize of the description information. - [out]
typeType of the description information, please refer to hbDNNDescType. - [in]
dnnPackedHandleHorizon DNN handle, pointing to multiple models.。 - [in]
indexhbm index。
- [out]
- Return Value
- Return
0means the API was successfully executed, otherwise the execution failed.
- Return
hbDNNInitializeFromFiles or hbDNNInitializeFromDDR can support loading multiple hbms at the same time, so the index range should be [0, modelFileCount) or [0, modelDataCount),
here modelFileCount and modelDataCount are parameters of the two interface parameters respectively.
