Function: get_function_addr
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
Obtains the start address of an operator on a device based on a kernel function handle. For operators that involve matrix and vector compute, an operator has two start addresses, which are executed on the Cube and Vector compute units, respectively. This API can be used to obtain the start addresses of operators on the Cube and Vector compute units. If the value of aivAddr obtained by calling this API is empty, the operator is executed only on the Cube Unit.
The AI data processing core unit varies with products.
-
For the following products, the start address of an operator on the AI Core is returned through the
aic_addrparameter.Atlas training products
Atlas inference products
-
For the following products, the start address of an operator on the Cube Core is returned through the
aic_addrparameter.Ascend 950PR&950DT products
Atlas A3 products
Atlas A2 products
Atlas 200I/500 A2 inference products
Prototype
-
C Prototype
aclError aclrtGetFunctionAddr(aclrtFuncHandle funcHandle, void **aicAddr, void **aivAddr) -
Python Function
aic_addr, aiv_addr, ret = acl.rt.get_function_addr(func_handle)
Parameters
| Parameter | Description |
|---|---|
| func_handle | Int, kernel function handle. |
Return Values
| Return Value | Description |
|---|---|
| aic_addr | Int, start address of an operator on the AI Core or Cube Core. |
| 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. If 0 is returned, the operation is successful. If other values are returned, the operation fails. |