Forum Discussion
There is no guarantee that anything coming out of aoc will be functional as this tool is now deprecated.
What are your complaints about SYCL compared to OpenCL?
I know that, but the replacement SYCL tools are that bad. The main problem is that icpx embeds the FPGA image into the host code so you can't have one binary that switches between multiple images via command line parameters. Nor one binary with kernels for multiple different devices. icpx also takes 10 seconds for simple examples which compile instantly in OpenCL. It wouldn't be so bad if you could use a regular C++ compiler for the host code and just use icpx for the device code, but I haven't found any (easy) way of accomplishing that.
- yuguen11 months ago
Occasional Contributor
@Björne2 wrote:The main problem is that icpx embeds the FPGA image into the host code so you can't have one binary that switches between multiple images via command line parameters.
You can extract the aocx from the produced binary:
https://www.intel.com/content/www/us/en/docs/oneapi-fpga-add-on/developer-guide/2024-1/extracting-the-fpga-hardware-configuration-aocx.html
@Björne2 wrote:Nor one binary with kernels for multiple different devices.
This is purpose of oneAPI (one API to target multiple devices) so I'm not sure what you are referring to here
@Björne2 wrote:icpx also takes 10 seconds for simple examples which compile instantly in OpenCL.
The legacy OpenCL compiler uses the same internal compiler as the SYCL compiler. So it should not be much slower.
I have two example designs:
- In SYCL: "time icpx -fsycl -fsycl-link=early [...]"real 0m9.221s
user 0m7.064s
sys 0m0.814s
- In OpenCL: "time aoc -rtl [...]"real 0m7.636s
user 0m3.490s
sys 0m0.724sThere is a difference, but not as big as 10 seconds to instant.
@Björne2 wrote:It wouldn't be so bad if you could use a regular C++ compiler for the host code and just use icpx for the device code, but I haven't found any (easy) way of accomplishing that.
SYCL is a superset of C++, so the host code written in SYCL is basically C++.
You can have a look at the SYCL code samples: https://github.com/oneapi-src/oneAPI-samples/tree/development/DirectProgramming/C%2B%2BSYCL_FPGA
In particular, you can have a look at the GettingStarted/fpga_compile sample to see a step by step C++ to SYCL example.
The SYCL example is 90% C++: https://github.com/oneapi-src/oneAPI-samples/blob/development/DirectProgramming/C%2B%2BSYCL_FPGA/Tutorials/GettingStarted/fpga_compile/part2_dpcpp_functor_usm/src/vector_add.cpp