TRACE_START

Function Usage

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 at the start point. This API is used together with TRACE_STOP.

Prototype

#define TRACE_START(apid)

Parameters

Parameter

Input/Output

Description

apid

Input

Currently, the following 10 user-defined types are reserved:

  • 0x0: USER_DEFINE_0
  • 0x1: USER_DEFINE_1
  • 0x2: USER_DEFINE_2
  • 0x3: USER_DEFINE_3
  • 0x4: USER_DEFINE_4
  • 0x5: USER_DEFINE_5
  • 0x6: USER_DEFINE_6
  • 0x7: USER_DEFINE_7
  • 0x8: USER_DEFINE_8
  • 0x9: USER_DEFINE_9

Returns

None

Availability

This macro supports all product models. However, the actual product models must be the same as those supported by the debugging tool.

Precautions

  • 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.

Example

Add TRACE_START and TRACE_STOP to the specific instruction position in the kernel code.

TRACE_START(0x2);
Add(zLocal, xLocal, yLocal, dataSize);
TRACE_STOP(0x2);