Skip to content

Commit

Permalink
CPU-based fixed-point math :godmode:
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jun 24, 2024
1 parent cb75956 commit 82c115e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ tags
CMakeCache.txt
CMakeFiles/
Makefile
*.cmake
include/OpenCL/
_build/
_cuda_build/
Expand Down
14 changes: 14 additions & 0 deletions cmake/FpMath.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(FPPOW "5" CACHE STRING "Log2 of float bits, for use in pairs as complex amplitudes (must be at least 2, equivalent to half precision)")
option(ENABLE_FIXED_POINT "Use fixed-point math instead of floating-point" OFF)

if (FPPOW LESS 4)
message(FATAL_ERROR "FPPOW must be at least 4, equivalent to \"half\" precision!")
endif (FPPOW LESS 4)

if (FPPOW GREATER 7)
message(FATAL_ERROR "FPPOW must be no greater than 7, equivalent to 128-bit precision!")
endif (FPPOW GREATER 7)

if (FPPOW LESS 5)
set(ENABLE_COMPLEX_X2 OFF)
endif (FPPOW LESS 5)

0 comments on commit 82c115e

Please sign in to comment.