Overview

General Restrictions

You cannot call the APIs in Profiling AscendCL API for Subscription (Subscription to Operator Information), including aclprofModelSubscribe, aclprofGet*, and aclprofModelUnSubscribe, between the aclprofInit and aclprofFinalize calls.

API Constraints

  • API requirements
    • aclprofInit must be called after aclInit and before model loading.

      If profiling configuration has been set by the aclInit call, the aclprofInit, aclprofStart, aclprofStop, or aclprofFinalize call returns an error.

      If aclprofInit is not called, an error is returned when calling aclprofStart, aclprofStop, or aclprofFinalize.

    • Call aclprofStart before the model is executed. If aclprofStart is called during model execution, only profile data after the aclprofStart call is collected, which may be incomplete.

      When calling aclprofStart, you can specify one or more devices to profile.

      In a user app process, an error is returned if aclprofStart is called repeatedly and the specified profiling configuration or device is duplicate.

    • In the lifetime of a user app process, do not repeatedly call the aclprofInit and aclprofFinalize pair. Otherwise, the path for storing profile data files may be changed.
    • aclprofStart must be used in pair with aclprofStop.
    • aclprofSetConfig must be called before aclprofStart interface. In an app process, aclprofSetConfig can be called once or multiple times as required.
    • After aclFinalize is called and a normal exit code is received, the execution is complete. Otherwise, the execution is abnormal. Due to the lack of support for multi-process concurrent execution in profile data collection, to ensure that the driver can be properly stopped, it is necessary to wait until the previous profile data collection test case is fully executed before starting the next round of collection. You are advised to add exception handling operations to the return value of aclFinalize to facilitate execution status display and exception localization.
  • API call sequence