Working with AI Engine Graphs - 2024.1 English

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

Document ID
UG1393
Release Date
2024-07-03
Version
2024.1 English
Tip: For an example of an embedded system design that includes an AI Engine graph application refer to Vitis-Tutorials/Developer_Contributed/01-Versal_Custom_Thin_Platform_Extensible_System/.

For Versal devices, the AI Engine graph application is an adaptive data flow (ADF) graph application. For more information on programming the AI Engine kernels and graph refer to AI Engine Kernel and Graph Programming Guide (UG1079).

The following is an example of how you would load and run the graph application from the software program.

  1. Add required header to #include statement:
    #include <experimental/xrt_aie.h>
    
  2. Set up the application environment as described in Specifying the Device ID and Loading the XCLBIN.
  3. Identify the AI Engine graph from the xrt::device object, the uuid of the loaded .xclbin, and the name of the graph application:
      auto my_graph  = xrt::graph(device, uuid, "mygraph_top");
    
  4. Reset and run the graph application from the software program as needed:
      my_graph.reset();
      std::cout << STR_PASSED << "my_graph.reset()" << std::endl;
      my_graph.run(0);
      std::cout << STR_PASSED << "my_graph.run()" << std::endl;
    

The graph application (libadf.a) is packaged as part of the device binary (.xclbin) by the v++ --package command, and also copied to the SD card. For more information refer to Compiling AI Engine Graph Applications.