aclmdlBundleLoadFromMem

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

Loads offline model data from memory, if variables need to be dynamically updated during model execution. The model workspace is managed by the system.

This API must be used with other APIs to dynamically update variables. For details, see aclmdlBundleLoadFromFile.

Prototype

1
aclError aclmdlBundleLoadFromMem(const void *model,  size_t modelSize, uint32_t *bundleId)

Parameters

Parameter

Input/Output

Description

model

Input

Pointer to the memory address for storing model data.

The model file is built using the graph build API. Call aclgrphBundleBuildModel to build the model, call aclgrphBundleSaveModel to save the model, and then load the saved .om model file into the memory.

In Ascend EP form, allocate memory on the host.

In Ascend RC form, allocate memory on the device.

In Ctrl CPU open form, allocate memory on the device.

modelSize

Input

Size of the model in the memory, in bytes.

bundleId

Output

Returns the bundle ID after the model is successfully loaded. The bundle ID is used for model identification in subsequent operations.

Returns

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