Function: binary_load_from_file

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

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 acl.rt.launch_kernel_with_config API must be used to deliver the compute task.

Prototype

  • C Prototype
    1
    aclError aclrtBinaryLoadFromFile(const char* binPath, aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)
    
  • Python Function
    1
    bin_handle, ret = acl.rt.binary_load_from_file(bin_path, options)
    

Parameters

Parameter

Description

bin_path

Str, 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

List, optional options for loading the operator binary file. For details about the structure, see aclrtBinaryLoadOptions. If the options are empty, set options to [].

Return Values

Return Value

Description

bin_handle

Int, handle of the operator binary file.

ret

Int, 0 on success; else, failure.

Restrictions

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