Compilation error with COMMON-AVX512 with icpc/icc (Intel C++ compiler)

Summary

When compiling with icpc/icc I have the following error :

Eigen/src/Core/MathFunctions.h(327): error: no instance of overloaded function "sqrt" matches the argument list argument types are: (const Eigen::internal::Packet8d) return sqrt(x); ^ Eigen/src/Core/MathFunctions.h(326): note: this candidate was rejected because arguments do not match EIGEN_USING_STD(sqrt); ^ Eigen/src/Core/MathFunctions.h(326): note: this candidate was rejected because arguments do not match EIGEN_USING_STD(sqrt); ^ Eigen/src/Core/MathFunctions.h(326): note: this candidate was rejected because arguments do not match EIGEN_USING_STD(sqrt); ^ Eigen/src/Core/MathFunctions.h(326): note: this candidate was rejected because at least one template argument could not be deduced EIGEN_USING_STD(sqrt); ^ Eigen/src/Core/MathFunctions.h(326): note: this candidate was rejected because at least one template argument could not be deduced EIGEN_USING_STD(sqrt); ^ /usr/include/bits/mathcalls.h(157): note: this candidate was rejected because arguments do not match __MATHCALL (sqrt,, (Mdouble __x)); ^ detected during: instantiation of "Scalar Eigen::internal::sqrt_impl::run(const Scalar &) [with Scalar=Eigen::internal::Packet8d]" at line 1467 instantiation of "Eigen::internal::sqrt_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::sqrt(const Scalar &) [with Scalar=Eigen::internal::Packet8d]" at line 815 of "Eigen/src/Core/GenericPacketMath.h" instantiation of "Packet Eigen::internal::psqrt(const Packet &) [with Packet=Eigen::internal::Packet8d]" at line 813 of "Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h" instantiation of "Packet Eigen::internal::psqrt_complex(const Packet &) [with Packet=Eigen::internal::Packet4cd]" at line 412 of "Eigen/src/Core/arch/AVX512/Complex.h"

Environment

  • Linux
  • Eigen : 3.4.0
  • Compiler : icpc (ICC) 19.1.1.217 20200306
  • Compile Flags : -O3 -xCOMMON-AVX512
  • Vector Extension : AVX512

Minimal Example

#include <Eigen/Core>
#include <iostream>

using namespace Eigen;
int main()
{
      MatrixXd _A0 = MatrixXd::Random(5,5);
      std::cout << _A0 << std::endl;
}

Steps to reproduce

Just compile the example with icpc and the option -O3 -xCOMMON-AVX512

Anything else that might help

I think the problem comes from Eigen/src/Core/arch/AVX512/MathFunctions.h

line 18 is : #if EIGEN_GNUC_AT_LEAST(5, 3) || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC >= 1923

where it should be #if EIGEN_GNUC_AT_LEAST(5, 3) || EIGEN_COMP_CLANG || EIGEN_COMP_MSVC >= 1923 || EIGEN_COMP_ICC >= 1900

Thanks

Edited by Pierre-Elie Normand