TRACE_START
Supported Products
Product |
Supported/Unsupported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
x |
|
√ |
Functions
Performs logging in any running phase of the operator when the CAModel is used for operator performance simulation. This helps to analyze the pipelines of different instructions for further performance optimization.
Indicates logging from the start point. This API is used together with TRACE_STOP.
This function is mainly used for debugging and performance analysis. After this function is enabled, the operator performance is affected. This function is usually used in the commissioning phase. You are advised to disable this function in the production environment.
By default, this function is disabled. You can enable the logging function as required.
1 2 3 4 | // Enable the dotting function of the operator. ascendc_compile_definitions(ascendc_kernels_${RUN_MODE} PRIVATE -DASCENDC_TRACE_ON ) |
Prototype
1 | #define TRACE_START(TraceId apid)
|
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
apid |
Input |
Currently, the following 10 user-defined types are reserved:
|
Returns
None
Restrictions
- TRACE_START and TRACE_STOP must be used together. If no log is displayed on the trace chart, they are not paired.
- This API cannot be used across cores. For example, if TRACE_START is logged in the AI Cube, TRACE_STOP must also be recorded in the AI Cube instead of the AI Vector.
- This macro supports all product models. However, the actual product models must be the same as those supported by the debugging tool.
- The dotting function can be enabled only in the kernel direct debugging project. It cannot be enabled in the custom operator project.
Examples
Add TRACE_START and TRACE_STOP to the specific instruction position in the kernel code.
1 2 3 | TRACE_START(0x2); Add(zLocal, xLocal, yLocal, dataSize); TRACE_STOP(0x2); |