Function: query_size_from_mem

C Prototype

aclError aclmdlQuerySizeFromMem(const void *model, size_t modelSize, size_t *workSize, size_t *weightSize)

Python Function

work_size, weight_size, ret = acl.mdl.query_size_from_mem(model, model_size)

Function Usage

Obtains the weight memory size and workspace size required for model execution based on the model data in the memory.

Input Description

model: int, pointer address of the model data whose memory information needs to be obtained.

model_size: int, model data length, in bytes.

Return Value

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.

Restrictions

The workspace and weight memory are all device memory, which need to be allocated and freed by the user.