Function: binary_load_from_file

Applicability

Product

Supported (√/x)

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

Function Usage

Loads and parses the operator binary file from a file, copies the operator binary file data to the device corresponding to the current context, and outputs the binHandle pointing 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 also be called to deliver a 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)
    

Parameter Description

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 Value Description

Return Value

Description

bin_handle

Int, handle of the operator binary file.

ret

Int, 0 on success; else, failure.

Restrictions

Operator binaries must be executed on the same hardware model for which they are compiled.