aclmdlQuerySize
Applicability
|
Product |
Supported |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Description
Obtains the weight memory size and workspace size required for model execution.
If the memory is managed by the user, before the allocation, you need to call this API to query the sizes of the workspace and weight memory required for model execution to avoid memory waste. If the shape of the input data is uncertain, you cannot call this API to query the memory size. As a result, you cannot manage the memory during model loading. Therefore, you need to call aclmdlLoadFromFile or aclmdlLoadFromMem to allow the system to manage the memory.
Prototype
aclError aclmdlQuerySize(const char *fileName, size_t *workSize, size_t *weightSize)
Parameters
Returns
0 on success; else, failure. For details, see aclError.