aclmdlBundleGetSize

Applicable Products

Product

Supported

Ascend 950PR / Ascend 950DT

√

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

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).