aclmdlBundleGetSize

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Usage

Obtains the weight memory size and workspace size required for graph execution based on the model description and graph index.

Prototype

1
aclError aclmdlBundleGetSize(const aclmdlBundleQueryInfo *queryInfo, size_t index, size_t *workSize, size_t *constWeightSize)

Parameters

Parameter

Input/Output

Description

queryInfo

Input

Data of the aclmdlBundleQueryInfo type created by calling aclmdlBundleCreateQueryInfo.

index

Input

Index.

After aclmdlBundleGetQueryModelNum is called to obtain the total number of graphs in a model, the value range of the index is [0, total_number_of_graphs – 1].

workSize

Output

Pointer to the workspace size required for graph execution, in bytes.

The workplace is device memory, which needs to be allocated and freed by the user.

weightSize

Output

Pointer to the weight memory size required for graph execution, in bytes.

The workplace is device memory, which needs to be allocated and freed by the user.

Returns

0 on success; else, failure. For details, see aclError.

Example

For details about the API call sequence and sample code, see Weight update (user-managed memory).