Function: register_cpu_func

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

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)
    

Parameters

Parameter

Description

bin_handle

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

func_name

str: entry point 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

Return Value

Description

func_handle

Int, kernel function handle.

ret

Int, 0 on success; else, failure.