Custom Profiling of the Host Application - 2022.1 English

Vitis Unified Software Platform Documentation: Application Acceleration Development (UG1393)

Document ID
UG1393
Release Date
2022-05-25
Version
2022.1 English

All XRT related actions from the host application are automatically tracked for profiling, through either theOpenCL API calls, or the XRT API calls. However, you can also profile the host application beyond the XRT related events, capturing event data based on user-specified actions or events.

Tip: You can use these features early in the design process as described in Baselining Functionality and Performance, even prior to separating functions to run in the Xilinx device hardware.
This feature provides two types of custom profiling:
User range
Profiles the specified start/end times across a range of code. This captures the span of time within which an action occurs in the host application.
User events
Marks an event in the timeline. The user event is added to the timeline waveform at whatever point in time it occurs.

The user_range and user_event data can be captured to the Profile Summary and Timeline Trace reports for display in Vitis analyzer. As seen in the figure below, the Profile Summary shows the number of occurrences of a given event and the range. The User Ranges table also reports the Min/Max/Avg/Total duration of the user-defined ranges in the host code. In the Timeline Trace report user_range elements in the host code are displayed in a separate row, and user_event markers are added at specific points on the timeline.

Figure 1. Profile Summary – User Range

Using custom profiling requires a few changes in your host application source code and build process. You must make use of C or C++ API in your code, as described below, and you must include the xrt_coreutil library when linking your host application.

Tip: An example of user_range and user_event can be seen in the host code at https://github.com/Xilinx/Vitis_Accel_Examples/blob/master/host/debug_profile/src/host.cpp.