xtensor-stack / xsimd

C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, AVX512, NEON, SVE))
https://xsimd.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
2.18k stars 254 forks source link

Various compiler errors #250

Closed tdegeus closed 5 years ago

tdegeus commented 5 years ago

I am getting a bunch of compiler errors with existing code:

[ 50%] Building CXX object CMakeFiles/Run.dir/main.cpp.o
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:3:
In file included from /usr/local/include/xtensor/xview.hpp:25:
In file included from /usr/local/include/xtensor/xcontainer.hpp:22:
/usr/local/include/xtensor/xmath.hpp:619:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/GooseFEM/Mesh.hpp:34:56: note: in instantiation of function template specialization 'xt::amax<void,
      const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy, int>' requested here
  xt::xtensor<size_t,1> renum = xt::empty<size_t>({xt::amax(dofs)[0]+1});
                                                       ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<xt::math::maximum<unsigned long>, xtl::identity, xt::math::maximum<unsigned long> >,
      Iterator2 = xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag>, Init = xt::evaluation_strategy::lazy, BinaryFunction =
      xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<xt::math::maximum<unsigned long>, xtl::identity, xt::math::maximum<unsigned long> >, E =
      const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:18:
In file included from /usr/local/include/GooseFEM/Mesh.h:52:
/usr/local/include/GooseFEM/Mesh.hpp:85:52: error: no matching function for call to 'amax'
  xt::xtensor<size_t,1> renum = xt::empty<size_t>({xt::amax(dofs)[0]+1});
                                                   ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:18:
In file included from /usr/local/include/GooseFEM/Mesh.h:52:
/usr/local/include/GooseFEM/Mesh.hpp:128:18: error: no matching function for call to 'amax'
  size_t nnode = xt::amax(conn)[0] + 1;
                 ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
/usr/local/include/xtensor/xmath.hpp:1703:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(sum, std::plus, big_promote_type_t<typename std::decay_t<E>::value_type>)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/GooseFEM/MeshTri3.hpp:349:46: note: in instantiation of function template specialization
      'xt::sum<void, xt::xtensor_container<xt::uvector<int, xsimd::aligned_allocator<int, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy, int>' requested here
  bool eq = static_cast<size_t>(std::abs(xt::sum(dir)[0])) == conn.shape()[0];
                                             ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<std::__1::plus<long long>, xtl::identity, std::__1::plus<long long> >, Iterator2 =
      xt::xtensor_container<xt::uvector<int, xsimd::aligned_allocator<int, 32> >, 1, xt::layout_type::row_major,
      xt::xtensor_expression_tag>, Init = xt::evaluation_strategy::lazy, BinaryFunction = xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<std::__1::plus<long long>, xtl::identity, std::__1::plus<long long> >, E =
      xt::xtensor_container<xt::uvector<int, xsimd::aligned_allocator<int, 32> >, 1, xt::layout_type::row_major,
      xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:3:
In file included from /usr/local/include/xtensor/xview.hpp:25:
In file included from /usr/local/include/xtensor/xcontainer.hpp:22:
/usr/local/include/xtensor/xmath.hpp:619:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/GooseFEM/MeshQuad4.hpp:460:28: note: in instantiation of function template specialization
      'xt::amax<void, const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long,
      32> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy, int>'
      requested here
  if ( i == 0 ) return xt::amax(m_nelx)[0];
                           ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<xt::math::maximum<unsigned long>, xtl::identity, xt::math::maximum<unsigned long> >,
      Iterator2 = xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag>, Init = xt::evaluation_strategy::lazy, BinaryFunction =
      xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<xt::math::maximum<unsigned long>, xtl::identity, xt::math::maximum<unsigned long> >, E =
      const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:3:
In file included from /usr/local/include/xtensor/xview.hpp:25:
In file included from /usr/local/include/xtensor/xcontainer.hpp:22:
/usr/local/include/xtensor/xmath.hpp:1703:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(sum, std::plus, big_promote_type_t<typename std::decay_t<E>::value_type>)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/GooseFEM/MeshQuad4.hpp:461:28: note: in instantiation of function template specialization
      'xt::sum<void, const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long,
      32> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy, int>'
      requested here
  else          return xt::sum (m_nhy )[0];
                           ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<std::__1::plus<unsigned long long>, xtl::identity, std::__1::plus<unsigned long long> >,
      Iterator2 = xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag>, Init = xt::evaluation_strategy::lazy, BinaryFunction =
      xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<std::__1::plus<unsigned long long>, xtl::identity, std::__1::plus<unsigned long long> >, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:21:
In file included from /usr/local/include/GooseFEM/MeshHex8.h:329:
/usr/local/include/GooseFEM/MeshHex8.hpp:989:29: error: no matching function for call to 'amax'
  if      ( i == 0 ) return xt::amax(m_nelx)[0];
                            ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:21:
In file included from /usr/local/include/GooseFEM/MeshHex8.h:329:
/usr/local/include/GooseFEM/MeshHex8.hpp:990:29: error: no matching function for call to 'amax'
  else if ( i == 2 ) return xt::amax(m_nelz)[0];
                            ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:21:
In file included from /usr/local/include/GooseFEM/MeshHex8.h:329:
/usr/local/include/GooseFEM/MeshHex8.hpp:991:29: error: no matching function for call to 'sum'
  else               return xt::sum (m_nhy )[0];
                            ^~~~~~~
/usr/local/include/xtensor/xmath.hpp:1703:30: note: candidate template ignored: substitution failure [with T = void, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 1,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(sum, std::plus, big_promote_type_t<typename std::decay_t<E>::value_type>)
                             ^
/usr/local/include/xtensor/xmath.hpp:1703:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:1703:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:1707:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(sum, std::plus, big_promote_type_t<typename std::decay_t<E>::value_type>)
                                 ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:22:
In file included from /usr/local/include/GooseFEM/Element.h:41:
/usr/local/include/GooseFEM/Element.hpp:51:18: error: no matching function for call to 'amax'
  size_t nnode = xt::amax(conn)[0]+1; // number of nodes
                 ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = const xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
/usr/local/include/xtensor/xmath.hpp:619:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/GooseFEM/VectorPartitioned.hpp:34:17: note: in instantiation of function template specialization
      'xt::amax<void, xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >,
      2, xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy, int>' requested
      here
  m_ndof  = xt::amax(m_dofs)[0] + 1;
                ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<xt::math::maximum<unsigned long>, xtl::identity, xt::math::maximum<unsigned long> >,
      Iterator2 = xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag>, Init = xt::evaluation_strategy::lazy, BinaryFunction =
      xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<xt::math::maximum<unsigned long>, xtl::identity, xt::math::maximum<unsigned long> >, E =
      xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:28:
In file included from /usr/local/include/GooseFEM/MatrixDiagonal.h:110:
/usr/local/include/GooseFEM/MatrixDiagonal.hpp:30:13: error: no matching function for call to 'amax'
  m_ndof  = xt::amax(m_dofs)[0] + 1;
            ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
In file included from /data/sim/22_depinning-inertia/Run/main.cpp:7:
In file included from /usr/local/include/GooseFEM/GooseFEM.h:29:
In file included from /usr/local/include/GooseFEM/MatrixDiagonalPartitioned.h:138:
/usr/local/include/GooseFEM/MatrixDiagonalPartitioned.hpp:34:13: error: no matching function for call to 'amax'
  m_ndof  = xt::amax(m_dofs)[0] + 1;
            ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate template ignored: substitution failure [with T = void, E
      = xt::xtensor_container<xt::uvector<unsigned long, xsimd::aligned_allocator<unsigned long, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    XTENSOR_REDUCER_FUNCTION(amax, math::maximum, typename std::decay_t<E>::value_type)
                             ^
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:619:30: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
/usr/local/include/xtensor/xmath.hpp:623:34: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    XTENSOR_MODERN_CLANG_REDUCER(amax, math::maximum, typename std::decay_t<E>::value_type)
                                 ^
/usr/local/include/xtensor/xmath.hpp:1703:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(sum, std::plus, big_promote_type_t<typename std::decay_t<E>::value_type>)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/xtensor/xmath.hpp:1756:16: note: in instantiation of function template specialization
      'xt::sum<void, xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy, int>' requested here
        return sum<T>(std::forward<E>(e), es) / static_cast<value_type>(size);
               ^
/data/sim/22_depinning-inertia/Run/main.cpp:315:12: note: in instantiation of function template specialization
      'xt::mean<void, xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, xt::evaluation_strategy::lazy,
      xt::concept_check_successful>' requested here
  if ( xt::mean(k)[0] != k(0,0) ) throw std::runtime_error("IOError: non-homogeneous elasticity detected");
           ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<std::__1::plus<double>, xtl::identity, std::__1::plus<double> >, Iterator2 =
      xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2, xt::layout_type::row_major,
      xt::xtensor_expression_tag>, Init = xt::evaluation_strategy::lazy, BinaryFunction = xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<std::__1::plus<double>, xtl::identity, std::__1::plus<double> >, E =
      xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2, xt::layout_type::row_major,
      xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
/data/sim/22_depinning-inertia/Run/main.cpp:316:8: error: no matching function for call to 'mean'
  if ( xt::mean(g)[0] != g(0,0) ) throw std::runtime_error("IOError: non-homogeneous elasticity detected");
       ^~~~~~~~
/usr/local/include/xtensor/xmath.hpp:1752:17: note: candidate template ignored: substitution failure [with T = void, E
      = xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> &, EVS = xt::evaluation_strategy::lazy, $3 =
      xt::concept_check_successful]
    inline auto mean(E&& e, EVS es = EVS())
                ^
/usr/local/include/xtensor/xmath.hpp:1740:17: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    inline auto mean(E&& e, X&& axes, EVS es = EVS())
                ^
/usr/local/include/xtensor/xmath.hpp:1770:17: note: candidate function template not viable: requires at least 2
      arguments, but 1 was provided
    inline auto mean(E&& e, const I (&axes)[N], EVS es = EVS())
                ^
/usr/local/include/xtensor/xmath.hpp:1703:5: error: call to 'reduce' is ambiguous
    XTENSOR_REDUCER_FUNCTION(sum, std::plus, big_promote_type_t<typename std::decay_t<E>::value_type>)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/xtensor/xmath.hpp:352:16: note: expanded from macro 'XTENSOR_REDUCER_FUNCTION'
        return reduce(make_xreducer_functor(functor_type()), std::forward<E>(e), es);                             \
               ^~~~~~
/usr/local/include/xtensor-blas/xlinalg.hpp:153:34: note: in instantiation of function template specialization
      'xt::sum<void, xt::xfunction<xt::math::pow_fun, xt::xfunction<xt::math::abs_fun, const
      xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2, xt::layout_type::row_major,
      xt::xtensor_expression_tag> &>, xt::xscalar<int> >, xt::evaluation_strategy::lazy, int>' requested here
                return std::sqrt(sum(pow(abs(v), 2))());
                                 ^
/usr/local/include/xtensor-blas/xlinalg.hpp:211:20: note: in instantiation of function template specialization
      'xt::linalg::norm<xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> >' requested here
            return norm(vec, normorder::frob);
                   ^
/data/sim/22_depinning-inertia/Run/main.cpp:522:36: note: in instantiation of function template specialization
      'xt::linalg::norm<xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2,
      xt::layout_type::row_major, xt::xtensor_expression_tag> >' requested here
        if ( stop.stop(xt::linalg::norm(fres)/xt::linalg::norm(fext), 1.e-5) )
                                   ^
/usr/local/include/xsimd/stl/algorithms.hpp:143:10: note: candidate function [with Iterator1 =
      xt::xreducer_functors<std::__1::plus<double>, xtl::identity, std::__1::plus<double> >, Iterator2 =
      xt::xfunction<xt::math::pow_fun, xt::xfunction<xt::math::abs_fun, const
      xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2, xt::layout_type::row_major,
      xt::xtensor_expression_tag> &>, xt::xscalar<int> >, Init = xt::evaluation_strategy::lazy, BinaryFunction =
      xsimd::detail::plus]
    Init reduce(Iterator1 first, Iterator2 last, Init init, BinaryFunction&& binfun = detail::plus{})
         ^
/usr/local/include/xtensor/xreducer.hpp:580:17: note: candidate function [with F =
      xt::xreducer_functors<std::__1::plus<double>, xtl::identity, std::__1::plus<double> >, E =
      xt::xfunction<xt::math::pow_fun, xt::xfunction<xt::math::abs_fun, const
      xt::xtensor_container<xt::uvector<double, xsimd::aligned_allocator<double, 32> >, 2, xt::layout_type::row_major,
      xt::xtensor_expression_tag> &>, xt::xscalar<int> >, EVS = xt::evaluation_strategy::lazy, $3 = int]
    inline auto reduce(F&& f, E&& e, EVS evaluation_strategy)
                ^
16 errors generated.
make[2]: *** [CMakeFiles/Run.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Run.dir/all] Error 2
make: *** [all] Error 2
JohanMabille commented 5 years ago

This has to be fixed in xtensor, the call to reduce has to be full-qualified, otherwise xsimd::reduce can be found via Argument Dependent Lookup because of the default argument xsimd::detail::plus.

this PR fixes the issue.