aclmdlLoadFromMem
Applicability
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Description
Loads offline model data from memory. The model workspace is managed by the system.
Prototype
aclError aclmdlLoadFromMem(const void *model, size_t modelSize, uint32_t *modelId)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
model |
Input |
Pointer to the address of the memory that stores the model. In In In Open Ctrl CPU form form, allocate memory on the device. For details about the memory allocation API, see Memory Management. |
|
modelSize |
Input |
Size of the model data in the memory, in bytes. |
|
modelId |
Output |
Pointer to the model ID. Returns the model ID after the model is successfully loaded. The model ID is used for model identification in subsequent operations. |
Returns
0 on success; else, failure. For details, see aclError.
Restrictions
The operations of loading, executing, and unloading a model must be performed in the same context. For details about how to create a context, see or . Before loading the model file, check whether the memory space is sufficient based on the size of the model file. If the memory space is insufficient, the application will be abnormal.
See Also
For the API call sequence, see Loading a Model.
The aclmdlSetConfigOpt and aclmdlLoadWithConfig APIs are provided for model loading. The caller needs to set the attributes in the configuration object passed to the API call to decide how the model will be loaded and who will manage the memory.