Examples of Kernel Conversion Function Prototypes - 2024.1 English

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
Release Date
2024.1 English

Examples of kernel conversions follows:

Example 1

Window-based function prototype:

void k1(input_window_cint16 * __restrict inputw_l, input_window_cint16 *  __restrict inputw_r, output_window_cint16 * __restrict output);

One dimension circular buffer port function prototype:

void k1_buffer_port(input_circular_buffer <cint16, adf::extents<adf::inherited_extent>, adf::margin<MARGIN_SIZE> > & __restrict inputw_l, input_circular_buffer <cint16, adf::extents<adf::inherited_extent>, adf::margin<MARGIN_SIZE> > & __restrict inputw_r, output_circular_buffer <cint16, adf::extents<adf::inherited_extent>> & __restrict output);

Example 2

Window-based function prototype:

void k2(input_window_cint16 * __restrict input_cb0, input_window_cint16 * __restrict input_cb1, input_window_cint16 * __restrict input_cb2, input_window_cint16 * __restrict input_cb3, input_window_cint16 * __restrict input_cb4, output_window_cint16 * __restrict output_cb);

One dimension buffer port function prototype:

void k2_buffer_port(input_buffer<cint16> & __restrict input_cb0, input_buffer<cint16> & __restrict input_cb1, input_buffer<cint16> & __restrict input_cb2, input_buffer<cint16> & __restrict input_cb3, input_buffer<cint16> & __restrict input_cb4, output_buffer<cint16> & __restrict output_cb);
Note: When the inherited size is specified as buffer port size in the function prototype, the actual buffer port size is specified using the dimensions() API in graph.