Function: get_op_num

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

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

√

Description

Obtains the number of operators in the specified memory space.

You are advised to create a thread and call this API in the new thread. Otherwise, this API call will block the main thread.

Prototype

  • C Prototype
    1
    aclError aclprofGetOpNum(const void *opInfo, size_t opInfoLen, uint32_t *opNumber)
    
  • Python Function
    1
    op_num, ret = acl.prof.get_op_num(op_info, op_info_len)
    

Parameters

Parameter

Description

op_info

Int, specified memory address.

After the size of the single-operator data structure is obtained by calling acl.prof.get_op_desc_size, you must allocate memory based on the value obtained by multiplying the size of the single-operator data structure by the integer coefficient. The memory is used to store operator data collected by Profiling and is used as the input of this API.

op_info_len

Int, length of the operator information.

Return Values

Return Value

Description

op_num

Int, number of operators.

ret

Int, error code.

  • 0 indicates success.
  • Other values indicate failure.