非同期循環バッファー - 2023.2 日本語

AI エンジン カーネルおよびグラフ プログラミング ガイド (UG1079)

Document ID
UG1079
Release Date
2023-12-04
Version
2023.2 日本語

次の例では、グラフで指定したバッファー サイズとマージン サイズ MARGIN_SIZE のデータ型 int32 を処理する非同期循環 1 次元入力バッファー (in0) と、データ型 int32 を処理する出力ストリーム (out0) を含むカーネル関数 k3 を宣言しています。

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

    in0.release();
}