Circular Input Buffer - 2025.2 English - UG1079

AI Engine Kernel and Graph Programming Guide (UG1079)

Document ID
UG1079
Release Date
2025-11-26
Version
2025.2 English

The following example declares the kernel function k2. The example uses an input circular buffer named in0 that operates on the int32 data type. th example also defines an output stream named out0, which operates on the int32 data type.

void k2(input_circular_buffer<int32, adf::extents<INPUT_SAMPLE_SIZE>, adf::margin<MARGIN_SIZE>> & in0, output_stream<int32> *out0)
{
    auto in0Iter = aie::begin_circular(in0);
    for (int ind = 0; ind < (INPUT_SAMPLE_SIZE + MARGIN_SIZE); ++ind)
    {
        writeincr(out0, *in0Iter++);
    }
}