[object Object][object Object]

Write the JSON file for operator definition. For details about the parameters, see and .

For example, the JSON configuration file is named add_test.json. Developers can modify test data and other configuration parameters based on this template.

[object Object]

Table 1 Parameters in the JSON file[object Object][object Object]

[object Object]undefined
[object Object]

Table 2 test_cases parameters[object Object][object Object]

[object Object]
[object Object]
[object Object]

mstx API Overview

MindStudio provides the mstx profiling API, which enables users to embed custom markers within their applications. These markers allow for the precise identification of critical code segments during performance analysis. For details, see and . For further details about the API usage, see MindStudio mstx API Reference.

Table 1 C/C++ mstx API List[object Object][object Object]

[object Object]undefined

Table 2 Python mstx API List[object Object][object Object]

[object Object]undefined

mstx API Usage

  • msOpProf allows users to use the mstx API to tune specific operators, customize the start time and end time of the code segment or specified key functions, identify key functions or computing APIs, and quickly demarcate performance issues.

  • The mstx API is disabled by default. If the mstx API is called in the application, the mstx instrumentation function is enabled based on the actual application scenario. For example, the --mstx=on flag enables mstx APIs within the user program, while --mstx-include can be used to target specific mstx APIs. For detailed usage, refer to the --mstx and --mstx-include parameters in the "Command Reference" sections of the and the .

  • The mstx API can be used via library files or header files. An implementation example can be found at this :

    [object Object]
    • Add the [object Object] library file located at [object Object] to the [object Object] file at [object Object].

      [object Object]
    • In the [object Object] file at [object Object], compile and link the user program with the [object Object] library. The corresponding header file [object Object] is located at [object Object].

      [object Object]

Example

After msOpProf is started, run the [object Object] command. This command will profile the operators defined within the [object Object] scope, specifically the [object Object] and [object Object] operators.

[object Object]