aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorghostop14 <ghostop14@gmail.com>2020-01-29 17:20:16 -0500
committerMichael Dickens <michael.dickens@ettus.com>2020-02-14 10:05:12 -0500
commitaa0bd44efbf8afdfd93d627e486c1427426b76f9 (patch)
treedd2acb4ebed83dc5a553678ba46b76424690b90a /CMakeLists.txt
parentgr-dtv: Use new FFT allocation scheme for DVB-T2 blocks. (diff)
downloadgnuradio-aa0bd44efbf8afdfd93d627e486c1427426b76f9.tar.xz
gnuradio-aa0bd44efbf8afdfd93d627e486c1427426b76f9.zip
gr-digital: Improve Performance of Costas Loop
This update is focused on improving the throughput of the Costas loop, however some changes are more global performance enhancements as this PR has evolved. Updates include an ENABLE_NATIVE added to CMake, which is off by default but enables native compiling (including FMA support) if desired; sincos was inlined in sincos.h and sincos.cc was removed from the appropriate CMake to improve sincos speed, some constants were added to math.h, inlined functions in costas loop and nco.h, used switch instead of function pointer (much faster), and used fast complex multiply to get around all the range checking in the standard complex.h complex multiply function on all builds.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 007166bbf..066e973f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -419,6 +419,20 @@ message(STATUS " Override with -DENABLE_INTERNAL_VOLK=ON/OFF")
find_package(LOG4CPP REQUIRED)
########################################################################
+# Setup Native Capabilities Flag
+########################################################################
+option(ENABLE_NATIVE "Enable native build optimizations" OFF)
+IF(UNIX)
+ IF (ENABLE_NATIVE)
+ MESSAGE(STATUS "Found GNU Radio native optimization flag. Setting native CPU optimization flags.")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -ftree-vectorize")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -ftree-vectorize")
+ ELSE (ENABLE_NATIVE)
+ MESSAGE(STATUS "Not using additional GNU Radio native architecture optimizations.")
+ ENDIF (ENABLE_NATIVE)
+ENDIF(UNIX)
+
+########################################################################
# Disable complex math NaN/INFO range checking for performance
########################################################################
check_cxx_compiler_flag(-fcx-limited-range HAVE_CX_LIMITED_RANGE)