This section describes how to collect profile data by using the Profiling AscendCL APIs for subscription to operator information. The purpose is to parse the collected profile data and write the data to pipelines. You need to read the data to the memory, and then call the related AscendCL API to obtain the profile data.
API calling: aclprofModelSubscribe, aclprofGet*, and aclprofModelUnSubscribe. The profile data of operators in the model can be obtained, including the operator name, operator type name, and operator execution time.
The APIs in this section cannot be called together with Profiling AscendCL API (Collecting and Flushing Profile Data). That is, aclprofInit, aclprofStart, aclprofStop, and aclprofFinalize cannot be called between aclprofModelSubscribe and aclprofModelUnSubscribe.
do not repeatedly call aclprofModelSubscribe.
Load a model --> aclprofModelSubscribe --> aclprofGetOpDescSize --> aclprofGetOpNum --> aclprofGetOpType/aclprofGetOpName/aclprofGetOpStart/aclprofGetOpEnd/aclprofGetOpDuration/aclprofGetModelId --> aclprofModelUnSubscribe
Load model 1 --> aclprofModelSubscribe (specify model 1) --> aclprofModelSubscribe (specify model 1) --> aclprofModelUnSubscribe