Graph Conversion - 2023.1 English

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
Release Date
2023.1 English

Connect statements with buffer port to buffer port do not require template parameters specifying the size. Use dimensions() API in graph to specify number of samples (not bytes) for all input/output buffer ports. Buffer port size (number of samples, not bytes) can also be specified using kernel function prototypes when dimensions() APIs in graph are not used.

Window-Based Connect Example

connect<window<EQ24_INPUT_SAMPLES*4, EQ24_INPUT_MARGIN*4> > (in.out[0],[0]);
connect<window<HB27_2D_INPUT_SAMPLES*4, HB_2D_INPUT_MARGIN*4> > (eq24.out[0],[0]) ;
connect<window<HB27_2D_INPUT_SAMPLES*4, HB_2D_INPUT_MARGIN*4> > (eq24.out[1],[1]) ;
connect<window<CE_INPUT_SAMPLES*4, CE_INPUT_MARGIN*4> > (hb27.out[0],[0]) ;

Buffer Port-Based Connect and Dimensions Example

connect(in.out[0],[0]) ;
connect(eq24.out[0],[0]) ;
connect(eq24.out[1],[1]) ;
adf::dimensions([0]) = { EQ24_INPUT_SAMPLES };
adf::dimensions([0]) = { HB27_2D_INPUT_SAMPLES };
adf::dimensions([1]) = { HB27_2D_INPUT_SAMPLES };
adf::dimensions(eq24.out[0]) = { EQ24_OUTPUT_SAMPLES };
adf::dimensions(eq24.out[1]) = { EQ24_OUTPUT_SAMPLES };
adf::dimensions(hb27.out[0]) = { HB27_2D_OUTPUT_SAMPLES };
adf::dimensions([0]) = { CE_INPUT_SAMPLES };   
Note: Margin size can be specified only in kernel function prototypes. Kernel Conversion section contains kernel function prototype with margin examples. The example above illustrates only graph code updates.