Visible to Intel only — GUID: mwh1391807498429
Ixiasoft
Visible to Intel only — GUID: mwh1391807498429
Ixiasoft
4. OpenCL Kernel Design Best Practices
In general, you should optimize a kernel that targets a single compute unit first. After you optimize this compute unit, increase performance by scaling the hardware to fill the remainder of the FPGA by increasing the number of compute units. For more information, refer to Multiple Compute Units. The area use of the kernel correlates with the time it takes for hardware compilation. Therefore, to avoid waiting for long hardware compiles, focus on optimizing the performance of your kernel on a single compute unit first.
For important best practices for optimizing kernel performance, including data processing and memory access optimizations, read through the remaining chapters of this guide. The remainder of this chapter covers the following list of additional best practices. Consider implementing the following design practices, if applicable, when your create your kernels.
- Transferring Data Via Intel FPGA SDK for OpenCL Channels or OpenCL Pipes
- Unrolling Loops
- Optimizing Floating-Point Operations
- Allocating Aligned Memory
- Aligning a Struct with or without Padding
- Maintaining Similar Structures for Vector Type Elements
- Avoiding Pointer Aliasing
- Avoid Expensive Functions
- Avoiding Work-Item ID-Dependent Backward Branching