kfrlib / kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
https://www.kfrlib.com
GNU General Public License v2.0
1.65k stars 253 forks source link

Template conversion issue (Visual Studio) #116

Closed SoulSharer closed 2 years ago

SoulSharer commented 3 years ago

Problem

After including several headers in order to do IIR filtering:

#include <kfr/base.hpp>
#include <kfr/dsp.hpp>
#include <kfr/io.hpp>

I get following errors:

Error   C2440   '<function-style-cast>': cannot convert from 'double' to 'kfr::avx::vec<cometa::f64,2>' projects\msvs_2017\_deps\kfr-src\include\kfr\simd\shuffle.hpp   145
Error   C2440   '<function-style-cast>': cannot convert from 'float' to 'kfr::avx::vec<cometa::f32,4>' projects\msvs_2017\_deps\kfr-src\include\kfr\simd\shuffle.hpp    145

I tried turning off AVX with USE_AVX_INSTRUCTIONS, it then had errors about converting to sse2. What might be the cause? Any ideas how to fix this?

Update

In an empty project with just a single dependency to KFR all is fine, trying to figure out what causes the problem to occur in the one I'm working on.

Update №2

Seems like KFR conflicts with Dlib.

Setup

Branch: master (beff806) CMake: 3.18.4 Toolset: Visual Studio 2017 (v141) C++ compiler: MSVC 19.16.27043.0

Note: ENABLE_DFT option is off.