Function: register_cpu_func

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

Registers an AI CPU operator to obtain func_handle when calling acl.rt.binary_load_from_data to load the operator binary data of the AI CPU. This API is used only for AI CPU operators. For other operators, ACL_ERROR_RT_PARAM_INVALID is returned.

Prototype

  • C Prototype
    1
    aclError aclrtRegisterCpuFunc(const aclrtBinHandle handle, const char *funcName, const char *kernelName, aclrtFuncHandle *funcHandle)
    
  • Python Function
    1
    func_handle, ret = acl.rt.register_cpu_func(bin_handle, func_name, kernel_name)
    

Parameter Description

Parameter

Description

bin_handle

Int, handle of the operator binary. Call acl.rt.binary_load_from_data to obtain the operator binary handle, and pass it as an input parameter.

func_name

Str, entry function for executing the AI CPU operator. The value cannot be null.

kernel_name

Str, opType of the AI CPU operator. The value cannot be null.

Return Value Description

Return Value

Description

func_handle

Int, kernel function handle.

ret

Int, 0 on success; else, failure.