Function: binary_get_function

Applicable Products

  • Ascend 950PR&950DT products: Supported
  • Atlas A3 products: Supported
  • Atlas A2 products: Supported
  • Atlas 200I/500 A2 inference products: Supported
  • Atlas inference products: Supported
  • Atlas training products: Supported

Function

Finds the corresponding kernel object based on kernel\_name and use func\_handle to express the object.

For the same bin\_handle, when acl.rt.binary_get_function is called for the first time, the operator binary data associated with bin\_handle is copied to the device corresponding to the current context by default.

Prototype

  • C Prototype

    aclError aclrtBinaryGetFunction(const aclrtBinHandle binHandle, const char *kernelName, aclrtFuncHandle *funcHandle)
    
  • Python Function

    func_handle, ret = acl.rt.binary_get_function(bin_handle, kernel_name)
    

Parameters

Parameter Description
bin_handle Int, handle pointing to the operator binary. Call acl.rt.binary_load to obtain binHandle.
kernel_name Str, kernel name.

Return Values

Return Value Description
func_handle Int, pointer address of the func_handle expression of the specified kernel.
ret Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails.