- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to test a compile for FPGA with 16 bit floats. These are defined in the header:
I took the ac_int sample and modified it to include the ap_float.hpp header.
ac_int sample:
This works ok if have only one file. If I have multiple includes however, I get the error below. So something is wrong with the definition of this library. The issue seems to only affect ap_float and not the other "ac_types".
I'm building for FPGA (and FPGA_EMULATOR). I've tried on oneapi 2024.1 and 2023.1. I'm using Quartus 2023.1 as backend FPGA compiler.
If you drop the attached files into the src directory of the ac_int sample, you should be able to reproduce the error.
The offending line is in mydefs.h line 6. If you remove that include then the compile will succeed.
Built as follows:
cd /my/path/to/ac_int
mkdir build
cd build
cmake ..
make
[ 16%] Building CXX object src/CMakeFiles/ac_int.fpga_emu.dir/ac_int.cpp.o
[ 33%] Building CXX object src/CMakeFiles/ac_int.fpga_emu.dir/mydefs.cpp.o
[ 50%] Linking CXX executable ../ac_int.fpga_emu
error: Linking globals named '_Z12get_exponentPKv': symbol multiply defined!
icpx: error: sycl-link command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/CMakeFiles/ac_int.fpga_emu.dir/build.make:113: ac_int.fpga_emu] Error 1
make[1]: *** [CMakeFiles/Makefile2:104: src/CMakeFiles/ac_int.fpga_emu.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I made the example simpler to exemplify the problem more directly. The error given above remains the same.
The error manifests when the ap_float.hpp header is included.
If I try to build "by hand" (i.e. without CMake) I get the same error:
icpx -fsycl -fintelfpga -qactypes -DFPGA_EMULATOR -Wall mydefs.cpp ac_int.cpp -o ac_int.exe
If I comment out the include on line 6 of mydefs.hpp and change the definition of MyFloat from ihc::bfloat16 to standard float, as below, then everything compiles fine.
#include <sycl/ext/intel/ac_types/ac_int.hpp>
//#include <sycl/ext/intel/ac_types/ap_float.hpp>
#include <sycl/ext/intel/fpga_extensions.hpp>
using MyInt14 = ac_int<14, true>;
using MyFloat = float;
//using MyFloat = ihc::bfloat16;
If I put all the code in one file, it compiles with the ap_float included without issue:
icpx -fsycl -fintelfpga -qactypes -DFPGA_EMULATOR -Wall onefile.cpp -o onefile.exe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm escalating your issue to our internal team and will work on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Thanks for taking a look. Are you trying this on Windows? Maybe you need this flag? "/EHsc" is mentioned as necessary for Windows. Maybe try adding that after the "-Wall " directive.
Karol.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce your issue. Our internal team will work on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This problem will be fixed for the 2025.0 release later this year.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page