Load and Store From Buffer Interface - Load and Store From Buffer Interface - 2026.1 English - UG1603

AI Engine-ML Kernel and Graph Programming Guide (UG1603)

Document ID
UG1603
Release Date
2026-07-08
Version
2026.1 English

AI Engine APIs provide access methods to read and write data from data memory, streaming data ports, and cascade streaming ports which can be used by AI Engine kernels.

In the following example, the const circular iterator reads an aie::vector<cint16,8> vector. Stream API readincr_v<8>(cin) reads a sample of int16 data from the cin stream. writeincr(cas_out, v) writes data to a cascade stream output.

void func(input_buffer<cint16> &din, 
			input_stream<int16> *cin, 
			output_cascade<cacc64> *cas_out){
        auto cirIter=aie::cbegin_vector_circular<8,512>(din);
	aie::vector<cint16,8> data=*cirIter++;
	aie::vector<int16,8> coef=readincr_v<8>(cin);
	aie::accum<cacc64,4> v;
	…
	writeincr(cas_out, v);
}

Iterators might not be suitable due to either semantic or performance issues. For example, if data types do not align with memory word-length, you can use buffer streams as an alternative. This is typically the case for block floating-point data (mx9) in AI Engine-ML v2. These streams link to a standard data buffer but follow a stream interface.