Visible to Intel only — GUID: mwh1391807499506
Ixiasoft
Visible to Intel only — GUID: mwh1391807499506
Ixiasoft
4.9. Avoiding Work-Item ID-Dependent Backward Branching
The Intel® FPGA SDK for OpenCL™ Offline Compiler collapses conditional statements into single bits that indicate when a particular functional unit becomes active. The offline compiler completely eliminates simple control flows that do not involve looping structures, resulting in a flat control structure and more efficient hardware usage. The offline compiler compiles kernels that include forward branches, such as conditional statements, efficiently.
For example, the following code fragment illustrates branching that involves work-item ID such as get_global_id or get_local_id:
for (size_t i = 0; i < get_global_id(0); i++)
{
// statements
}