aclrtBinaryLoadFromData

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

Loads and parses the operator binary data from the memory and outputs the binHandle that points to the operator binary data.

When calling this API to load an AI CPU operator (aclrtBinaryLoadOption.type contains ACL_RT_BINARY_LOAD_OPT_CPU_KERNEL_MODE), call aclrtRegisterCpuFunc to register the operator.

The system only loads the operator to the device corresponding to the current context. Therefore, when aclrtLaunchKernelWithConfig is called to start the compute task for the operator, the device on which the task is performed must be the same as the device to which the operator is loaded.

Prototype

1
aclError aclrtBinaryLoadFromData(const void *data, size_t length, const aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)

Parameters

Parameter

Input/Output

Description

data

Input

Address of the host memory for storing the operator binary data. The value cannot be null.

length

Input

Memory size of the operator binary data, in bytes. The value must be greater than 0.

options

Input

Optional parameter for loading the operator binary file. For details about the type definition, see aclrtBinaryLoadOptions.

binHandle

Output

Operator binary handle. For details about the type definition, see aclrtBinHandle.

Returns

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