ADF Graph - 2023.2 English

Vitis Libraries

Release Date
2023.2 English

An AI Engine program consists of a data flow graph specification written in C++. The dataflow graph consists of top level ports, kernel instances and connectivity. a graph.h file is created which includes the header adf.h.

For more details on data flow graph creation, please refer AI Engine Programming .

#include "kernels.h"
#include <adf.h>

using namespace adf;

class myGraph : public adf::graph {
    kernel k1;
    port<input> inptr;
    port<output> outptr;
    port<input> kernelCoefficients;

  myGraph() {
     k1 = kernel::create(filter2D);
     adf::connect<window<TILE_WINDOW_SIZE> >(inptr,[0]);
     adf::connect<parameter>(kernelCoefficients, async([1]));
     adf::connect<window<TILE_WINDOW_SIZE> >(k1.out[0], outptr);

     source(k1) = "";
     // Initial mapping
     runtime<ratio>(k1) = 0.5;