aclrtBinaryLoadFromFile

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 file from a file and outputs the binHandle that points to the operator binary file.

For AI Core operators, if this API is used to load and parse the operator binary file, the aclrtLaunchKernelWithConfig, aclrtLaunchKernelV2, or aclrtLaunchKernelWithHostArgs API must also be called to deliver a compute task.

Prototype

1
aclError aclrtBinaryLoadFromFile(const char* binPath, aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)

Parameters

Parameter

Input/Output

Description

binPath

Input

Path of the operator binary file (*.o file). The path must be an absolute path.

For AI CPU operators, this parameter can be set to an operator library file (*.json).

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.

Restrictions

The operator binary file generated during the compilation of a product model must be used on the product of the same model.

API Call Example

For the API call example, see AI Core Custom Operator Loading.