Visible to Intel only — GUID: GUID-1655B481-7549-4493-98EA-D240CFC78FB4
Visible to Intel only — GUID: GUID-1655B481-7549-4493-98EA-D240CFC78FB4
Device Selectors for FPGA
Depending on whether you are targeting the FPGA emulator or FPGA hardware, you must use the correct SYCL* device selector in the host code. You can use the FPGA hardware device selector for simulation also. The following host code snippet demonstrates how you can use a selector to specify the target device at compile time:
// FPGA device selectors are defined in this utility header, along with // all FPGA extensions such as pipes and fpga_reg #include <sycl/ext/intel/fpga_extensions.hpp> int main() { // Select either: // - the FPGA emulator device (CPU emulation of the FPGA) // - the FPGA simulator // - the FPGA device (a real FPGA) #if FPGA_SIMULATOR auto selector = sycl::ext::intel::fpga_simulator_selector_v; #elif FPGA_HARDWARE auto selector = sycl::ext::intel::fpga_selector_v; #else // #if FPGA_EMULATOR auto selector = sycl::ext::intel::fpga_emulator_selector_v; #endif queue q(selector); ... }
- The FPGA emulator and the FPGA are different target devices. Intel® recommends using a preprocessor define to choose between the emulator and FPGA selectors. This makes it easy to switch between targets using only command-line flags. For example, you can compile the above code snippet for the FPGA emulator by passing the flag -DFPGA_EMULATOR to the icpx command.
Since FPGAs support only the ahead-of-time compilation method, dynamic selectors (such as the default_selector) are less useful that explicit selectors when targeting FPGAs.
Did you find the information on this page useful?
Feedback Message
Characters remaining: