aclmdlLoadFromMem

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 OM model file data from memory. The model workspace is managed by the system.

For details about how to obtain the OM model file, see Command-Line Options > Basic Options > General Options > --mode in ATC.

Prototype

1
aclError aclmdlLoadFromMem(const void *model, size_t modelSize, uint32_t *modelId)

Parameters

Parameter

Input/Output

Description

model

Input

Pointer to the memory address for storing model data.

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 data in the memory, in bytes.

modelId

Output

Pointer to the model ID.

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

Returns

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

Reference

The aclmdlSetConfigOpt and aclmdlLoadWithConfig APIs are provided for model loading. The caller needs to set the attributes in the configuration object passed to the API call to decide how the model will be loaded and who will manage the memory.