2.6.4. Emulating Your OpenCL Kernel - To emulate your OpenCL kernel, run the emulation .aocx file on the platform on which you build your kernel. - 2025-12-16

FPGA SDK for OpenCL Pro Edition Getting Started Guide

Version
22.4
Product Type
Development Software and Tools > FPGA Design & Simulation Tools > Quartus Prime Design Software > Pro Edition
Device Families > Arria Families > Arria 10
Device Families > MAX Families > MAX 10
Device Families > Agilex Families
Device Families > Stratix Families > Stratix 10
Development Software and Tools > FPGA Design & Simulation Tools > Quartus Prime Design Software
Device Families > Agilex Families > Agilex 7
Device Families > Cyclone Families
Device Families > Arria Families
Device Families > Stratix Families
Device Families > MAX Families
Device Families > Cyclone Families > Cyclone 10
Resource Type
Documentation > User Guides
ft:sourceName
DITA
To emulate your OpenCLâ„¢ kernel, run the emulation .aocx file on the platform on which you build your kernel.

To emulate your kernel, perform the following steps:

  1. To run the host application for emulation, first define the number of emulated devices by invoking the set CL_CONFIG_CPU_EMULATE_DEVICES=<number_of_devices> command and then run the host application.
    This command specifies the number of identical emulation devices that the Emulator needs to provide. By default, the emulator platform provides a single emulator device. Therefore, if your host code requires only a single device, you do not need to set the CL_CONFIG_CPU_EMULATE_DEVICES environment variable. The host application for the hello_world design example only requires a single device, so you may skip setting this environment variable.
    Remember: When you compile the host and run for the emulator platform, only the emulated devices are available, that is, access to all physical boards is disabled.
  2. After you run the host application, unset the CL_CONFIG_CPU_EMULATE_DEVICES variable by invoking the set CL_CONFIG_CPU_EMULATE_DEVICES= command.
Upon successful emulation of your kernel, you should see the following output:
...
...
...

Using AOCX: hello_world.aocx

Kernel initialization is complete.

Launching the kernel...

Thread #2: Hello from Intel FPGA OpenCL Compiler!

Kernel execution is complete.