Synchronous Buffer Port Access - 2023.1 English - UG1079

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
UG1079
Release Date
2023-06-23
Version
2023.1 English

A kernel reads from its input buffers and writes to its output buffers. By default, the synchronization that is required to wait for an input buffer of data is performed before entering the kernel. The synchronization that is required to provide an empty output buffer is also performed before entering the kernel. There is no synchronization needed for synchronous buffer ports within the kernel to read or write the individual samples of data after the kernel has started execution.

Buffer port size can be declared via dimensions() API or with kernel function prototype.

Option 1
Configure with dimensions() API in graph.
connect netN(in.out[0], k.in[0]);
dimensions(k.in[0])={INPUT_SAMPLE_SIZE};
Option 2
Configure with kernel function prototype where function prototypes are declared in kernel header files and which is referenced in graph code.

Graph code specifies connection.

connect netN(in.out[0], k.in[0]);

Kernel code specifies data type and buffer size.

void simple(input_buffer<int32, adf::extents<INPUT_SAMPLE_SIZE>> & in,
          output_buffer<int32, adf::extents<OUTPUT_SAMPLE_SIZE>> & out);