Function: binary_load_from_file
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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
1aclError aclrtBinaryLoadFromFile(const char* binPath, aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)
- Python Function
1bin_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.