ID 683846
Date 12/19/2022
Public

## 5.2.12. Specifying Number of Compute Units

To increase the data-processing efficiency of an OpenCL™ kernel, you can instruct the Intel® FPGA SDK for OpenCL™ Offline Compiler to generate multiple kernel compute units. Each compute unit is capable of executing multiple work-groups simultaneously.
CAUTION:
Multiplying the number of kernel compute units increases data throughput at the expense of FPGA resource consumption and global memory bandwidth contention between compute units.
To specify the number of compute units for a kernel, insert the num_compute_units(N) attribute in the kernel source code.
For example, the code fragment below directs the offline compiler to instantiate two compute units in a kernel:
__attribute__((num_compute_units(2)))
__kernel void test(__global const float * restrict a,
__global const float * restrict b,
}