用于前移当前读/写位置 |
选项 1 是使用迭代器:void simple(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
auto pIn = aie::begin(in);
TYPE data = *pIn++;
...
选项 2 是使用 data() API: void simple_1(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
const TYPE* pIn=in.data();
TYPE data = pIn[index++];
...
|
选项 1 是使用迭代器:void simple(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
auto pOut= aie::begin(out);
TYPE data;
*pOut++ = data;
...
选项 2 是使用 data() API: void simple_1(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
const TYPE* pOut =(TYPE*)out.data();
pOut[index++] = data;
...
|
用于前移当前读/写位置,前移的值为底层缓冲器端口类型的 4 倍。 |
#define VECTOR_SIZE 4
void simple(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
auto pIn = aie::begin_vector<VECTOR_SIZE>(in);
v4TYPE data = *pIn++;
...
|
#define VECTOR_SIZE 4
void simple(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
auto pOut = aie::begin_vector<VECTOR_SIZE>(out);
v4TYPE data;
*pOut++ = data;
...
|
用于前移当前读/写位置,前移的值为底层缓冲器端口类型的 8 倍。 |
#define VECTOR_SIZE 8
void simple(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
auto pIn = aie::begin_vector<VECTOR_SIZE>(in);
v8TYPE data = *pIn++;
...
|
#define VECTOR_SIZE 8
void simple(input_buffer<TYPE> & in, output_buffer<TYPE> & out)
{
auto pOut = aie::begin_vector<VECTOR_SIZE>(out);
v8TYPE data;
*pOut++ = data;
...
|