Visible to Intel only — GUID: GUID-1CB2A088-EDBB-4D1C-9D8B-9FB22FFBEBEB
Visible to Intel only — GUID: GUID-1CB2A088-EDBB-4D1C-9D8B-9FB22FFBEBEB
Targeting Multiple Platforms
To compile a design that targets multiple target device types (using different device selectors), you can run the following commands:
Emulation Compile
For compiling your SYCL* code for the FPGA emulator target, execute the following commands:
# For Linux: icpx -fsycl jit_kernel.cpp -c -o jit_kernel.o icpx -fsycl -fintelfpga -fsycl-link=image fpga_kernel.cpp -o fpga_kernel.a icpx -fsycl -fintelfpga main.cpp jit_kernel.o fpga_kernel.a
# For Windows: icx-cl -fsycl jit_kernel.cpp -c -o jit_kernel.o icx-cl -fsycl -fintelfpga -fsycl-link=image fpga_kernel.cpp -o fpga_kernel.lib icx-cl -fsycl -fintelfpga main.cpp jit_kernel.o fpga_kernel.lib
The design uses libraries and includes an FPGA kernel (AOT flow) and a CPU kernel (JIT flow).
Specifically, there should be a main function residing in the main.cpp file and two kernels for both CPU (jit_kernel.cpp) and FPGA (fpga_kernel.cpp).
Sample jit_kernel.cpp file:
sycl::cpu_selector device_selector; queue deviceQueue(device_selector); deviceQueue.submit([&](handler &cgh) { // CPU Kernel function });
Sample fpga_kernel.cpp file:
#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 deviceQueue(device_selector); deviceQueue.submit([&](handler &cgh) { // FPGA Kernel Function });
FPGA Hardware Compile
To compile for the FPGA hardware target, add the -Xshardware flag and remove the -DFPGA_EMULATOR flag, as follows:
# For Linux: icpx -fsycl jit_kernel.cpp -c -o jit_kernel.o //Hardware compilation command. Takes a long time to complete. icpx -fsycl -fintelfpga -fsycl-link=image -Xshardware fpga_kernel.cpp -o fpga_kernel.a icpx -fsycl -fintelfpga main.cpp jit_kernel.o fpga_kernel.a
# For Windows: icx-cl -fsycl jit_kernel.cpp -c -o jit_kernel.o //Hardware compilation command. Takes a long time to complete. icx-cl -fsycl -fintelfpga -fsycl-link=image -Xshardware fpga_kernel.cpp -o fpga_kernel.lib icx-cl -fsycl -fintelfpga main.cpp jit_kernel.o fpga_kernel.lib