Function: binary_load_from_data

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

Description

Loads and parses the binary data of the AI CPU operator from the memory, and outputs the binHandle pointing to the operator binary.

When calling this API to load an AI CPU operator (option_type in aclrtBinaryLoadOptions contains ACL_RT_BINARY_LOAD_OPT_CPU_KERNEL_MODE), call acl.rt.register_cpu_func to register the operator.

Prototype

  • C Prototype
    1
    aclError aclrtBinaryLoadFromData(const void *data, size_t length, const aclrtBinaryLoadOptions *options, aclrtBinHandle *binHandle)
    
  • Python Function
    1
    bin_handle, ret = acl.rt.binary_load_from_data(mem_addr, length, options)
    

Parameters

Parameter

Description

mem_addr

Int, address of the host memory for storing the operator binary data. The value cannot be null.

length

Int, memory size of the operator binary data, in bytes. The value must be greater than 0.

options

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

Return Value

Return Value

Description

bin_handle

Int, handle of the operator binary file.

ret

Int, 0 on success; else, failure.