Function: get_function_addr

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

Obtains the start address of an operator on a device based on a kernel function handle. For operators that involve cube and vector computation, there are two start addresses for each operator, one on the Cube Unit and the other on the Vector Unit. This API can be used to obtain the start addresses of the operators on the Cube Unit and Vector Unit. If the value of aivAddr obtained by calling this API is empty, the operator is executed only on the Cube Unit.

Prototype

  • C Prototype
    1
    aclError aclrtGetFunctionAddr(aclrtFuncHandle funcHandle, void **aicAddr, void **aivAddr)
    
  • Python Function
    1
    aic_addr, aiv_addr, ret = acl.rt.get_function_addr(func_handle)
    

Parameter Description

Parameter

Description

func_handle

Int, kernel function handle.

Return Value Description

Return Value

Description

aic_addr

Int, start address of an operator on the AI Core or Cube Core.

  • For the following products, the start address of an operator on the AI Core is returned.

    Atlas training products

    Atlas inference products

  • For the following products, the start address of an operator on the Cube Core is returned.

    Atlas A3 training products/Atlas A3 inference products

    Atlas A2 training products/Atlas A2 inference products

    Atlas 200I/500 A2 inference products

aiv_addr

Int, start address of an operator on the Vector Core.

If the value of aivAddr obtained by calling this API is empty, the operator is not executed on the Vector Core.

ret

Int, 0 on success; else, failure.