Load and Store From Buffer Interface - 2024.1 English

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

Document ID
UG1603
Release Date
2024-06-06
Version
2024.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 is used to read an aie::vector<cint16,8> vector. Stream API readincr_v<8>(cin) is used to read a sample of int16 data from the cin stream. writeincr(cas_out, v) is used to write 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);
}