Obtains the weight memory size and workspace size required for model execution based on the model data in the memory. This API is synchronous.
The workspace and weight memory are all device memory, which need to be allocated and freed by the user.
aclError aclmdlQuerySizeFromMem(const void *model, size_t modelSize, size_t *workSize, size_t *weightSize)
Parameter |
Input/Output |
Description |
|---|---|---|
model |
Input |
Pointer to model data. |
modelSize |
Input |
Model size in bytes. |
workSize |
Output |
Pointer to the workspace size required for model execution, in bytes. |
weightSize |
Output |
Pointer to the weight memory size required for model execution, in bytes. |
0 on success; else, failure.