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

ID 683678
Date 9/24/2018
Document Table of Contents

3.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. Run the utility command aocl linkflags to find out which libraries are necessary for building a host application. The software lists the libraries for both emulation and regular kernel compilation flows.
  2. Link your host application to the libraries returned by the aocl linkflags utility command.
  3. Move the hello_world_emulation.aocx file to the current working directory so that the host can locate it easily.
  4. To run the host application for emulation, invoke the env CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=<number_of_devices> <host_application_filename> command.
    This command specifies the number of identical emulation devices that the Emulator needs to provide.

Each invocation of the emulated kernel creates a shared library copy called <process_ID> in a default temporary directory, where <process_ID> is a unique numerical value assigned to each emulation run. You may override the default directory by setting the TMPDIR environment variable.