Function: get_op_name

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

You are advised to 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 delivers the same function as acl.prof.get_op_name_v2. However, the acl.prof.get_op_name_v2 API is used to obtain the length of the operator name and allocate the corresponding space. You do not need to pass arguments to specify the space required by the operator name. You are advised to use the acl.prof.get_op_name_v2 API first.

Prototype

  • C Prototype
    1
    aclError aclprofGetOpName(const void *opInfo, size_t opInfoLen, uint32_t index, char *opName, size_t opNameLen)
    
  • Python Function
    1
    op_name, ret = acl.prof.get_op_name(op_info, op_info_len, index, op_name_len)
    

Parameter Description

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 Value Description

Return Value

Description

op_name

Str, operator name.

ret

Int, error code.

  • 0 indicates success.
  • Other values indicate failures.

Reference

For the API call example, see Profile Data Collection.