No matching function for call to "..." in 'Complex.h' and 'GenericPacketMathFunctions.h'
Summary
Multiple failures during compilation with clang on Windows (under MSYS2), pertaining to a mixture of wrapper and native types.
Environment
- Operating System : Windows
- Architecture : x64
- Eigen Version : 3.4 rc1 (no failures in 3.3.9)
- Compiler Version : clang 11.0.0 (gnu)
- Compile Flags : -O0 -march=native
- Vector Extension : SSE/AVX
Minimal Example
Does not need any special code, just importing an Eigen header is sufficient.
What is the current bug behavior?
Multiple template deduction failures due to mixing of Packet2cf
and Packet1cd
values (__m128
and __m128d
respectively) with wrapper variables (Packet4f
and Packet2d
).
Relevant logs
E.g.
[build] ../third-party/eigen-3.4\Eigen/src/Core/arch/SSE/Complex.h:74:30: error: no matching function for call to 'pxor'
[build] return Packet2cf(padd(a.v, pxor(mask, b.v)));
[build] ^~~~
[build] ../third-party/eigen-3.4\Eigen/src/Core/GenericPacketMath.h:304:1: note: candidate template ignored: deduced conflicting types for parameter 'Packet' ('Eigen::internal::eigen_packet_wrapper<__attribute__((__vector_size__(4 * sizeof(float)))) float, 0>' vs. '__attribute__((__vector_size__(4 * sizeof(float)))) float' (vector of 4 'float' values))
[build] pxor(const Packet& a, const Packet& b) {
[build] ^
Anything else that might help
Changing the storage of the complex packets to that of the wrapper seemed to fix the issue for me, don't know however if there are potential side-effects that can surge from the change:
Like so:
struct Packet2cf
{
EIGEN_STRONG_INLINE Packet2cf() {}
EIGEN_STRONG_INLINE explicit Packet2cf(const __m128& a) : v(a) {}
__m128 v;
};
to
struct Packet2cf
{
EIGEN_STRONG_INLINE Packet2cf() {}
EIGEN_STRONG_INLINE explicit Packet2cf(const __m128& a) : v(a) {}
Packet4f v;
};
and the same in Packet1cd
with Packet2d
.