Compile and Emulate Your Design
- Modify the host part of your program to declare aext::intel::fpga_emulator_selectordevice selector. Use thisdevice_selectorwhen instantiating a device queue for enqueuing your FPGA device kernel.
- Compile your design by including the-fintelfpgaoption in yourdpcppcommand to generate an executable.
- Run the resulting executable:
If you want to use only one emulator device, you need not set theCL_CONFIG_CPU_EMULATE_DEVICESenvironment variable.
- For Windows:
- Define the number of emulated devices by invoking the following command:set CL_CONFIG_CPU_EMULATE_DEVICES=<number_of_devices>
- Run the executable.
- Invoke the following command to unset the variable:set CL_CONFIG_CPU_EMULATE_DEVICES=
- For Linux, invoke the following command:env CL_CONFIG_CPU_EMULATE_DEVICES=<number_of_devices> <executable_filename>This command specifies the number of identical emulation devices that the emulator must provide.
- The Intel® FPGA Emulation Platform for OpenCL™ does not provide access to physical boards. Only the emulated devices are available.
- The emulator is built with GCC 7.4.0 as part of theIntel® oneAPI. When running the executable for an emulated FPGA device, the version ofDPC++/C++Compilerlibstdc++.somust be at least that of GCC 7.4.0. In other words, theLD_LIBRARY_PATHenvironmentvariable must ensure that the correct version oflibstdc++.sois found.If the correct version oflibstdc++.sois not found, the call toclGetPlatformIDsfunction fails to load the FPGA emulator platform and returnsCL_PLATFORM_NOT_FOUND_KHR(error code-1001). Depending on which version oflibstdc++.sois found, the call toclGetPlatformIDsmay succeed, but a later call to theclCreateContextfunction may fail withCL_DEVICE_NOT_AVAILABLE(error code-2).If theLD_LIBRARY_PATHdoes not point to a compatiblelibstdc++.so, use the following syntax to invoke the host program:env LD_LIBRARY_PATH=<path to compatible libstdc++.so>:$LD_LIBRARY_PATH <executable> [executable arguments]