aclrtBinaryLoadFromFile

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

Description

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

Handle of the operator binary file. 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.