OpenCL Attributes

Optimizations in OpenCL

This section describes OpenCL™ attributes that can be added to source code to assist system optimization by the SDAccel™ compiler, xocc, the SDSoC™ system compilers, sdscc and sds++, and Vivado® HLS synthesis.

SDx™ provides OpenCL attributes to optimize your code for data movement and kernel performance. The goal of data movement optimization is to maximize the system level data throughput by maximizing interface bandwidth utilization and DDR bandwidth utilization. The goal of kernel computation optimization is to create processing logic that can consume all the data as soon as they arrive at kernel interfaces. This is generally achieved by expanding the processing code to match the data path with techniques such as function inlining and pipelining, loop unrolling, array partitioning, dataflowing, etc.

The OpenCL attributes include the types specified below:
Table 1. OpenCL __attributes__ by Type
Type Attributes
Kernel Size
Function Inlining
Task-level Pipeline
Loop Unrolling
Array Optimization
Note: Array variables only accept a single array optimization attribute.
TIP: The SDAccel and SDSoC compilers also support many of the standard attributes supported by gcc, such as always_inline, noinline, unroll, and nounroll.