There can be multiple partitions in an AI Engine array. Each of these AI
Engine partitions contain independent graphs. The xclbin file
generated by the v++ packager
includes the metadata for all
partitions. For information about the v++
building
flow, see Compiling AI Engine Graph for Independent Partitions.
A handle to a graph in a partition can be retrieved from the device after
loading the xclbin. You can use this handle to control the
graph. To do so, the graph name is prefixed with the partition name in the
xrt::graph(device,uuid,"pr0_gr")
API. Following is example code
used to control the pr0
and pr1
partitions:
// Open xclbin
auto device = xrt::device(0); //device index=0
auto uuid = device.load_xclbin(xclbinFilename);
//Create handle for graph "gr" in partition "pr0"
auto ghdl1=xrt::graph(device,uuid,"pr0_gr");
ghdl1.run(iterations);
//Create handle for graph "gr" in partition "pr1"
auto ghdl2=xrt::graph(device,uuid,"pr1_gr");
ghdl2.run(iterations);
ghdl1.wait();
ghdl2.wait();