AI Engine Graph API Methods - 2025.2 English - UG1076

AI Engine Tools and Flows User Guide (UG1076)

Document ID
UG1076
Release Date
2025-11-20
Version
2025.2 English

The AI Engine Graph API for host applications simplifies migration between Linux and bare-metal host applications by aligning with the XRT API syntax. When compiling host application with ADF API, a deprecation message displays.

Note: Control applications for AI Engine simulator still requires the ADF API.

The following table compares the ADF API with the AI Engine Graph API for host applications. The graph object instance in the table is declared as graph for the ADF API and gr for the AI Engine Graph API.

Table 1. AI Engine Graph Methods Comparison
Type ADF APl AI Engine Graph API Comment
Graph control
graph.init()
gr.init()
 
 
graph.run()
gr.run(<iterations>)
Omitting iterations argument repeats the number of iterations in previous run. Setting -1 run the graph forever or until end() is called.
 
graph.wait()
gr.wait()
 
 
graph.end()
<err_code> gr.end()
 
 
graph.update()
<err_code> gr.update(<port_name>, <data>, <length>)
length is the data size in bytes.
GMIO
GMIO::malloc()
<pointer> gr.malloc(<length>)
 
 
GMIO::free()
gr.free(<pointer>)
 
 
graph.in.gm2aie()
gr.gm2aie(<name>, <data>, <length>)
 
 
graph.in.aie2gm()
gr.aie2gm(<name>, <data>, <length>)
 
 
graph.in.gm2aie_nb()
gr.gm2aie_nb(<name>, <data>, <length>)
 
 
graph.in.aie2gm_nb()
gr.aie2gm_nb(<name>, <data>, <length>)
 
External buffer API
external_buffer::setAddress()
gr.setAddress(<ext_buf_name>, <pointer>)
 
 
external_buffer::wait()
gr.wait(<ext_buf_name>, <port_name>)
 
 
external_buffer::gm2aie()
<err_code> gm2aie_nb(<ext_buf_name>, <port_name>)
 
 
external_buffer::aie2gm()
<err_code> aie2gm_nb(<ext_buf_name>, <port_name>)
 
 
external_buffer::setupPingPongBuffers()
<err_code> setupPingPongBuffers(<ext_buf_name>, <pointer1>, <pointer2>)
 
Profiling
event::start_profiling()
<id_num> start_profiling(<port_name>, <option>, <value>)
 
   
<id_num>start_profiling(<port_name1>, <port_name1>, <option>, <value>)
Use to start profiling two ports with one command
 
event::read_profiling()
<id_num>read_profiling(<id_num>)
 
 
event::stop_profiling()
stop_profiling(<id_num>)
 
Clocking  
<err_code> clock_enable()
 
   
<err_code> clock_disble()