File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,21 @@ endif()
99
1010option (DSPLIB_POOL_ALLOCATOR "Use pool allocator for vectors" OFF )
1111option (DSPLIB_ASAN_ENABLED "Address sanitizer enabled" OFF )
12+ option (DSPLIB_USE_FLOAT32 "Use float32 for base type dsplib::real_t" OFF )
1213
1314if (DSPLIB_ASAN_ENABLED)
1415 include (cmake/sanitizer.cmake)
1516 enable_address_sanitizer(TARGET dsplib)
1617endif ()
1718
1819if (DSPLIB_POOL_ALLOCATOR)
19- message (STATUS "dsplib: use pool allocator" )
20+ message ("dsplib: use pool allocator" )
2021 target_compile_definitions (dsplib PUBLIC "DSPLIB_POOL_ALLOCATOR" )
22+ endif ()
23+
24+ if (DSPLIB_USE_FLOAT32)
25+ message ("dsplib: base type dsplib::real_t = float32" )
26+ target_compile_definitions (dsplib PUBLIC "DSPLIB_USE_FLOAT32" )
27+ else ()
28+ message ("dsplib: base type dsplib::real_t = float64" )
2129endif ()
Original file line number Diff line number Diff line change @@ -41,8 +41,11 @@ namespace dsplib {
4141
4242// -------------------------------------------------------------------------------------------------
4343// base scalar type
44+ #ifdef DSPLIB_USE_FLOAT32
45+ using real_t = float ;
46+ #else
4447using real_t = double ;
45- // using real_t = float;
48+ # endif
4649
4750constexpr real_t pi = 3.141592653589793238463 ;
4851
You can’t perform that action at this time.
0 commit comments