Subscription API Usage Description
General Restrictions
The APIs in this section cannot be called together with Profiling Data Collection APIs. That is, aclprofInit, aclprofStart, aclprofStop, and aclprofFinalize cannot be called between aclprofModelSubscribe and aclprofModelUnSubscribe.
API Constraints
- API call requirements:
- Call aclprofModelSubscribe before the model is executed. If aclprofModelSubscribe is called during model execution, only profile data after the aclprofModelSubscribe call is collected, which may be incomplete.
- aclprofModelSubscribe must be used together with aclprofModelUnSubscribe. Before aclprofModelUnSubscribe is called, aclprofModelSubscribe cannot be called repeatedly to subscribe to the same model.
- It is not allowed to pass a non-existent model ID to the aclprofModelSubscribe call.
- It is not allowed to pass a non-existent or unsubscribed model ID to the aclprofModelUnSubscribe call.
- If multiple models are loaded to the same device, the subscription configurations delivered to the models are the same.
- API call sequence:
- The following API call sequence is recommended:
Load a model --> aclprofModelSubscribe --> aclprofGetOpDescSize --> aclprofGetOpNum --> aclprofGetOpType/aclprofGetOpName/aclprofGetOpStart/aclprofGetOpEnd/aclprofGetOpDuration/aclprofGetModelId --> aclprofModelUnSubscribe
- The following is an example of an incorrect call sequence. In this example, the same model is repeatedly subscribed:
Load model 1 --> aclprofModelSubscribe (specify model 1) --> aclprofModelSubscribe (specify model 1) --> aclprofModelUnSubscribe
- The following API call sequence is recommended:
Parent topic: Subscription to Operator Information