Visible to Intel only — GUID: GUID-8E030233-0B8D-477D-8CE5-59CE1BC26298
Visible to Intel only — GUID: GUID-8E030233-0B8D-477D-8CE5-59CE1BC26298
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 device (a real FPGA, can be used for simulation too) #if defined(FPGA_EMULATOR) ext::intel::fpga_emulator_selector device_selector; #elif defined(FPGA_SIMULATOR) ext::intel::fpga_simulator_selector device_selector; #else ext::intel::fpga_selector device_selector; #endif queue q(device_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: