Function: query_size_from_mem
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Obtains the weight memory size and workspace size required for model execution based on the model data in the memory.
Prototype
- C Prototype
1aclError aclmdlQuerySizeFromMem(const void *model, size_t modelSize, size_t *workSize, size_t *weightSize)
- Python Function
1work_size, weight_size, ret = acl.mdl.query_size_from_mem(model, model_size)
Parameter Description
Parameter |
Description |
|---|---|
model |
Int, pointer address of the model data whose memory information needs to be obtained. |
model_size |
Int, model size in bytes. |
Return Value Description
Return Value |
Description |
|---|---|
work_size |
Int, workspace size required for model execution, in bytes. |
weight_size |
Int, weight memory size required for model execution, in bytes. |
ret |
Int, error code: 0 on success; else, failure. |
Restrictions
The workspace and weight memory are all device memory, which need to be allocated and freed by the user.