Function: get_op_num

C Prototype

aclError aclprofGetOpNum(const void *opInfo, size_t opInfoLen, uint32_t *opNumber)

Python Function

op_num, ret = acl.prof.get_op_num(op_info, op_info_len)

Function Usage

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.

Input Description

op_info: int, memory address of the operator information.

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 Value

op_num: int, number of operators.

ret: int, error code.

Restrictions

None

Reference

For the API call example, see Profile Data Collection.