Skip to content

Commit 14bc085

Browse files
authored
FPGA: Set fp model to "precise" for ac_fixed sample (#1483)
* set fp-model to precise for emu only * set fp-model to precise for all platforms
1 parent 0426d80 commit 14bc085

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

DirectProgramming/C++SYCL_FPGA/Tutorials/Features/ac_fixed/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ When you use the `ac_fixed` library, keep the following points in mind:
132132

133133
The host program for this tutorial shows the accuracy differences between the result provided by floating point math library and the result provided by the `ac_fixed` math library functions, where the `float` version generates a more accurate result than the smaller-sized `ac_fixed` version.
134134

135+
Note: the program is compiled with fp-model set to "precise", so the accuracy of the floating-point math functions conform to the IEEE standard.
136+
135137
- Emulation vs FPGA Hardware for fixed point math operations
136138

137139
Due to the differences in the internal math implementations, the results from `ac_fixed` math functions in emulation and FPGA hardware might not always be bit-accurate. This tutorial shows how to build and run the sample for emulation and FPGA hardware so you can observe the difference.

DirectProgramming/C++SYCL_FPGA/Tutorials/Features/ac_fixed/src/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ endif()
1919
# 2. /Qactypes Include ac_types headers and link against ac_types emulation libraries
2020
if(WIN32)
2121
set(WIN_FLAG "/EHsc")
22-
set(AC_TYPES_FLAG "/Qactypes")
22+
set(AC_TYPES_FLAG "/Qactypes /fp:precise")
2323
else()
24-
set(AC_TYPES_FLAG "-qactypes")
24+
set(AC_TYPES_FLAG "-qactypes -fp-model=precise")
2525
endif()
2626

2727
# A SYCL ahead-of-time (AoT) compile processes the device code in two stages.

0 commit comments

Comments
 (0)