Intel® FPGA SDK for OpenCL™ Pro Edition: Best Practices Guide

ID 683521
Date 9/26/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

5.2. Instrumenting the Kernel Pipeline with Performance Counters (-profile)

To instrument the OpenCL kernel pipeline with performance counters, include the -profile=(all|autorun|enqueued) option of the aoc command when you compile your kernel.
Note: Instrumenting the Verilog code with performance counters increases hardware resource utilization (that is, increases FPGA area usage) and typically decreases performance.
To instrument the Verilog code in the <your_kernel_filename>.aocx file with performance counters, invoke the aoc -profile=(all|autorun|enqueued) <your_kernel_filename>.cl command, where:
  • all argument instruments all kernels in the <your_kernel_filename>.cl file with performance counters. This is the default option if no argument is provided.
  • autorun argument instruments only the autorun kernels with performance counters.
  • enqueued argument instruments only the non-autorun kernels with performance counters.
Note:
  • When profiling multiple, different kernels, do not use the same kernel names across different .aocx files. If the kernel names are the same, the profile data is wrong for these kernels.
  • Regardless of the input to the clGetProfileDataDeviceIntelFPGA host library call, the Intel® FPGA dynamic profiler for OpenCL™ only profiles kernel types that you indicate during compilation.
  • Instrumenting the OpenCL kernel pipeline with performance counters on all or enqueued kernels disables the use of hardware kernel invocation queue by the OpenCL runtime environment. This may result in different profile time.
CAUTION:
Profiling autorun kernels results in some hardware overhead for the counters. For large designs, the overhead can cause fMAX and design frequency degradation. It can also lead to designs that cannot fit on the chip if the Intel® FPGA dynamic profiler for OpenCL™ profiles every kernel.