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 resolution error in VS2019 #75

Closed jiandingzhe closed 4 years ago

jiandingzhe commented 4 years ago

I downloaded code package 4.0.0, and compiled kfr_dft using CMake 3.16.4 + VS2019. It claims following template error:

(My visual studio is zh_CN language. I translated Chinese parts to English, so the message would be different from that of a en_US visual studio)

1>D:\development\kfr-4.0.0\include\kfr\simd\impl\backend_generic.hpp(1793,80): error C2593: “operator ==” is not clear
1>D:\development\kfr-4.0.0\include\kfr\cometa\../cometa.hpp(448,20): message : could be “bool cometa::cvals_t<T1,0,2,8,10,4,6,12,14>::operator ==<0,1,2,3,4,5,6,7>(cometa::cvals_t<T,0,1,2,3,4,5,6,7>) noexcept const”
1>        with
1>        [
1>            T1=size_t,
1>            T=unsigned __int64
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\cometa\../cometa.hpp(730,1): message : or    “Ret cometa::ops::operator ==<T1,0,2,8,10,4,6,12,14,T,0,1,2,3,4,5,6,7,cometa::cvals_t<bool,true,false,false,false,true,false,false,false>>(cometa::cvals_t<T,0,2,8,10,4,6,12,14>,cometa::cvals_t<T,0,1,2,3,4,5,6,7>)”
1>        with
1>        [
1>            Ret=cometa::cvals_t<bool,true,false,false,false,true,false,false,false>,
1>            T1=size_t,
1>            T=unsigned __int64
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\simd\impl\backend_generic.hpp(1779,1): message : when trying to match parameter list “(Indices, const cometa::cvals_t<T,0,1,2,3,4,5,6,7>)”
1>        with
1>        [
1>            T=unsigned __int64
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\simd\impl\backend_generic.hpp(386): message : see reference to instantiation of function template “__m256 kfr::avx::intrinsics::universal_shuffle<float,16,0,2,8,10,4,6,12,14,8>(kfr::avx::intrinsics::simd_t<float,16>,const kfr::avx::intrinsics::simd_halves<T,16> &,cometa::cvals_t<T1,0,2,8,10,4,6,12,14>)”
1>        with
1>        [
1>            T=float,
1>            T1=size_t
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\simd\vec.hpp(306): message : see reference to instantiation of function template “__m256 kfr::avx::intrinsics::simd_shuffle<8,0,2,8,10,4,6,12,14,8>(kfr::avx::intrinsics::simd2_t<float,8,8>,const __m256 &,const __m256 &,cometa::cvals_t<T1,0,2,8,10,4,6,12,14>,cometa::overload_priority<2>) noexcept”
1>        with
1>        [
1>            T1=size_t
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\base\../simd/shuffle.hpp(296): message : see reference to instantiation of function template “kfr::avx::vec<cometa::f32,8> kfr::avx::vec<cometa::f32,8>::shuffle<0,2,8,10,4,6,12,14>(const kfr::avx::vec<cometa::f32,8> &,cometa::cvals_t<T1,0,2,8,10,4,6,12,14>) noexcept const”
1>        with
1>        [
1>            T1=size_t
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\base\../simd/shuffle.hpp(297): message : see reference to instantiation of function template “kfr::avx::vec<cometa::f32,8> kfr::avx::vec<cometa::f32,8>::shuffle<0,2,8,10,4,6,12,14>(const kfr::avx::vec<cometa::f32,8> &,cometa::cvals_t<T1,0,2,8,10,4,6,12,14>) noexcept const”
1>        with
1>        [
1>            T1=size_t
1>        ]
1>D:\development\kfr-4.0.0\include\kfr\dft\impl\ft.hpp(198): message : see reference to instantiation of function template “kfr::avx::vec<cometa::f32,8> kfr::avx::shuffle<0,2,8,10,cometa::f32,8,4>(const kfr::avx::vec<cometa::f32,8> &,const kfr::avx::vec<cometa::f32,8> &,cometa::cvals_t<unsigned __int64,0,2,8,10>)”
1>D:\development\kfr-4.0.0\include\kfr\base\../simd/platform.hpp(94): message : see reference to instantiation of class template “cometa::cval_t<kfr::cpu_t,6>”
1>D:\development\kfr-4.0.0\include\kfr\cometa\../cometa.hpp(365): message : see reference to instantiation of class template “cometa::cval_t<bool,false>”
1>D:\development\kfr-4.0.0\include\kfr\cometa\../cometa.hpp(364): message : see reference to instantiation of class template “cometa::cval_t<bool,true>”
dancazarin commented 4 years ago

KFR DFT requires LLVM/clang. You can install Clang and set clang-cl.exe as C++ compiler for cmake project. README.md contains instructions how to do that.

VS2019 contains bugs that prevent from building DFT correctly. https://github.com/kfrlib/kfr/issues/70