host.cpp Main Functions - 2023.2 English

Vitis Tutorials: Hardware Acceleration (XD099)

Document ID
XD099
Release Date
2023-11-13
Version
2023.2 English

The main function contains the following sections marked in the source accordingly.

  1. Environment / Usage Check

  2. Common Parameters:

    • numBuffers: Not expected to be modified. This parameter is used to determine how many kernel invocations are performed.

    • oooQueue: This boolean value is used to declare the kind of OpenCL event queue that is generated inside the ApiHandle.

    • processDelay: This parameter can be used to artificially delay the computation time required by the kernel. This parameter is not used in this version of the tutorial.

    • bufferSize: This parameter is used to declare the number of 512-bit values to be transferred per kernel invocation.

    • softwarePipelineInterval: This parameter is used to determine how many operations can be pre-scheduled before synchronization occurs.

  3. Setup: To ensure that you are aware of the status of configuration variables, this section prints out the final configuration.

  4. Execution: In this section, you can model several different host code performance issues. These are the lines you will focus on for this tutorial.

  5. Testing: After execution has completed, this section performs a simple check on the output.

  6. Performance Statistics: If the model is run on an actual accelerator card (not emulated), the host code will calculate and print the performance statistics based on system time measurements.

NOTE: The setup, as well as the other sections, can print additional messages recording the system status, as well as overall PASS or FAIL of the run.