Intel® FPGA SDK for OpenCL™ Pro Edition: Getting Started Guide

ID 683188
Date 12/19/2022
Public
Document Table of Contents

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.

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.