Visible to Intel only — GUID: wfa1476380079940
Ixiasoft
Visible to Intel only — GUID: wfa1476380079940
Ixiasoft
3.4. Loops in a Single Work-Item Kernel
The number of clock cycles between the launch of one loop iteration and the next is called the loop's initiation interval (II). An optimally pipelined loop has an II value of 1 because a new loop iteration is launched every clock cycle.
The Intel® FPGA SDK for OpenCL™ Offline Compiler may not pipeline every loop in the kernel. If a loop is not pipelined, a loop iteration can not begin until the previous iteration finishes executing. In this case, only one loop iteration is active in the loop's datapath at a time. View the HTML report to find out which loops are pipelined, and for pipelined loops, what is their II.
Consider the following example:
kernel void simple_loop (unsigned N,
global unsigned* restrict b,
global unsigned* restrict c,
global unsigned* restrict out)
{
for (unsigned i = 1; i < N; i++) {
c[i] = c[i-1] + b[i];
}
out[0] = c[N-1];
}
The figure depicts how the offline compiler uses loop pipelining to execute simple_loop efficiently. The figure shows that the loop's datapath contains three loop iterations at the same time. Therefore, this loop is pipelined. The figure also shows that a new loop iteration enters the datapath every clock cycle. Therefore, the loop has II=1.