Forum Discussion
Hi Petry_Carlos, sorry for the slow reply.
I'm not sure which code sample you are referring to; there are multiple vector add examples in the oneAPI code samples. Generally, the code samples use CMake as a build system so you can either pass the FPGA target as an argument to cmake, or you can modify the CMakeLists.txt build scripts.
Our `fpga_compile` sample includes a CMakeLists.txt build script that lets you set the target device at compile time:
On Linux*
Change to the sample directory.
For different parts of this tutorial, navigate to the appropriate sub-folder.
cd <partX_XXX>
where <partX_XXX> is:
- part1_cpp
- part2_dpcpp_functor_usm
- part3_dpcpp_lambda_usm
- part4_dpcpp_lambda_buffers
Build the program for Intel® Agilex® 7 device family, which is the default.
mkdir build cd build cmake ..
Note: You can change the default target by using the command:
cmake .. -DFPGA_DEVICE=<FPGA device family or FPGA part number>
Alternatively, you can target an explicit FPGA board variant and BSP by using the following command:
cmake .. -DFPGA_DEVICE=<board-support-package>:<board-variant>
You will only be able to run an executable on the FPGA if you specified a BSP.
https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/C%2B%2BSYCL_FPGA/Tutorials/GettingStarted/fpga_compile#generate-the-makefiles-for-the-parts
Furthermore, the FPGA Template code sample includes a CMakeLists.txt file that you can customize for your own designs
https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/C%2B%2BSYCL_FPGA/Tutorials/GettingStarted/fpga_template
About "which code sample i am referring to", I followed the instructions on this site:
using the "oneapi-cli" command and choosing: "create a project->cpp->vector Add".
About the "Simulation system generation failed" message, I decided to remove and reinstall the whole oneAPI tool again, so I got rid of this problem.
Regarding the "-DFPGA_DEVICE=..." option, my question was which string I should put, finally I tested it using the part number and it seemed to work.
So, I tested it again with the "fpga" target (make fpga) and DUSM=1 option.
Furthermore, I successfully programmed the FPGA using the Quartus Prime, based on the 'prj' directory created by oneAPI.
But, when I run the executable on the host I get this error:
-----------------------------------
An exception is caught while computing on device.
terminate called after throwing an instance of 'sycl::_V1::runtime_error'
what(): No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (PI_ERROR_DEVICE_NOT_FOUND)
Aborted (core dumped)
-----------------------------------
I have access to a Cyclone FPGA (ID 10CX220YF780E5G).
Let me know if I made any mistakes or if there are any other issues to consider.
Thanks.