aclmdlQuerySizeFromMem

Description

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

Restrictions

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

Prototype

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

Parameters

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.

Returns

0 on success; else, failure.