kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit ff62ffaaf1d15dfb80b2d8b2517bb834f6cff751
parent 7c4bee81d8a99fb745ae7fe1ed8e4365a741c972
Author: [email protected] <[email protected]>
Date:   Mon, 25 Nov 2019 06:10:31 +0000

Move cconj to simd module

Diffstat:
Minclude/kfr/math/complex_math.hpp | 9---------
Minclude/kfr/simd/complex.hpp | 10++++++++++
Mtests/CMakeLists.txt | 8++++----
3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/include/kfr/math/complex_math.hpp b/include/kfr/math/complex_math.hpp @@ -142,7 +142,6 @@ KFR_INTRINSIC vec<complex<T>, N> csqr(const vec<complex<T>, N>& x) return x * x; } -KFR_HANDLE_SCALAR(cconj) KFR_HANDLE_SCALAR(csin) KFR_HANDLE_SCALAR(csinh) KFR_HANDLE_SCALAR(ccos) @@ -182,7 +181,6 @@ KFR_INTRINSIC realtype<T1> carg(const T1& a) } } // namespace intrinsics -KFR_I_FN(cconj) KFR_I_FN(csin) KFR_I_FN(csinh) KFR_I_FN(ccos) @@ -284,13 +282,6 @@ KFR_FUNCTION internal::expression_function<fn::carg, E1> carg(E1&& x) return { fn::carg(), std::forward<E1>(x) }; } -/// @brief Returns template expression that returns the complex conjugate of the complex number x -template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>)> -KFR_FUNCTION internal::expression_function<fn::cconj, E1> cconj(E1&& x) -{ - return { fn::cconj(), std::forward<E1>(x) }; -} - /// @brief Returns the natural logarithm of the complex number x template <typename T1, KFR_ENABLE_IF(is_numeric<T1>)> KFR_FUNCTION T1 clog(const T1& x) diff --git a/include/kfr/simd/complex.hpp b/include/kfr/simd/complex.hpp @@ -441,7 +441,10 @@ KFR_INTRINSIC vec<complex<T>, N> cconj(const vec<complex<T>, N>& x) { return cnegimag(x); } + +KFR_HANDLE_SCALAR(cconj) } // namespace intrinsics +KFR_I_FN(cconj) /// @brief Returns the complex conjugate of the complex number x template <typename T1, KFR_ENABLE_IF(is_numeric<T1>)> @@ -450,6 +453,13 @@ KFR_INTRINSIC T1 cconj(const T1& x) return intrinsics::cconj(x); } +/// @brief Returns template expression that returns the complex conjugate of the complex number x +template <typename E1, KFR_ENABLE_IF(is_input_expression<E1>)> +KFR_FUNCTION internal::expression_function<fn::cconj, E1> cconj(E1&& x) +{ + return { fn::cconj(), std::forward<E1>(x) }; +} + template <size_t N> struct vec_of_complex { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt @@ -185,12 +185,12 @@ if (NOT SKIP_TESTS) COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/multiarch) endif () - add_test(NAME all_tests - COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/all_tests) - if (ARCH_TESTS) foreach(A IN LISTS ARCH_LIST) - add_test(NAME ${A} COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/all_tests_${A}) + add_test(NAME all_tests_${A} COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/all_tests_${A}) endforeach() + else () + add_test(NAME all_tests + COMMAND ${EMULATOR} ${PROJECT_BINARY_DIR}/bin/all_tests) endif () endif ()