Knowledge Base Article
How to link two OneAPI kernels to two accelerate cards, respectively, with one host code?
Description
If you want to link two OneAPI kernels to two accelerate cards respectively with one host code, you may find the following limitations when targeting multiple FPGA devices:
• All FPGA devices use the same FPGA bitstream.
• All FPGA devices used must be of the same FPGA card (same -Xstarget target)
Resolution
To workaround this limitation, you can use a dynamic linking to build two images and then link them dynamically as below:
- icpx -fsycl -fPIC -fintelfpga -c vector_add.cpp -o vector_add.o
- icpx -fsycl -fPIC -shared -fintelfpga -Xshardware -Xsboard= vector_add.o -o vector_add.so
- icpx -fsycl -fPIC -fintelfpga -c vector_mul.cpp -o vector_mul.o
- icpx -fsycl -fPIC -shared -fintelfpga -Xshardware -Xsboard= vector_mul.o -o vector_mul.so
- icpx -fsycl -o main.exe main.cpp vector_add.so vector_mul.so
Updated 2 months ago
Version 2.0No CommentsBe the first to comment