Function: get_op_name

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 name of a specified operator.

As a best practice, the user can create a thread and call this API in the new thread. Otherwise, this API call will block the main thread.

acl.prof.get_op_name and acl.prof.get_op_name_v2 function the same. However, acl.prof.get_op_name_v2 obtains the length of the operator name and allocates the corresponding space. You do not need to pass arguments to specify the space required by the operator name. You are advised to use acl.prof.get_op_name_v2.

Prototype

  • C Prototype

    aclError aclprofGetOpName(const void *opInfo, size_t opInfoLen, uint32_t index, char *opName, size_t opNameLen)
    
  • Python Function

    op_name, ret = acl.prof.get_op_name(op_info, op_info_len, index, op_name_len)
    

Parameters

Parameter Description
op_info Int, specified memory address.
op_info_len Int, length of the operator information.
index Int, operator index.
The value range is [0, Operator count – 1]. Call acl.prof.get_op_num to obtain the operator count.
op_name_len Int, length of operator name. The value range is [1, 257].

Return Values

Return Value Description
op_name Str, operator name.
ret Int, error code.
0: success
Other values: failure