Skip to content

Comparaison warning when compiling a code that call contract on a slice using auto

Summary

When I send a .slice to a function that .contract I get a warning at compilation - even if everything works fine at runtime.

Environment

  • Operating System : Linux
  • Architecture : x64
  • Eigen Version : Main
  • Compiler Version : Gcc13.2.1
  • Compile Flags : -std=c++20
  • Vector Extension : None (afaik)

Minimal Example

#include <unsupported/Eigen/CXX11/Tensor>

using Eigen::Tensor;
using Eigen::array;
using Eigen::Index;

class Class1 {
public:
    void get_direction(
            auto &input_view,
            int height, int width) {
        Tensor<float, 1> direction_weights(2);
        Eigen::array<Eigen::IndexPair<int>, 1> product_dims = {Eigen::IndexPair<int>(2, 0)};
        Tensor<float, 3> weight_map = input_view.contract(direction_weights, product_dims)
                .reshape(array<Eigen::Index, 3>{height, width, 1})
                .broadcast(array<Eigen::Index, 3>{1, 1, 2});
    }
};

class Class2 {
public:
    Tensor<float, 3> map;
    Class1 class1;

    auto get_view() {
        auto view_offsets = array<Eigen::Index, 3>{0, 0, 0};
        auto view_dims = array<Eigen::Index, 3>{2, 2, 2};
        auto view = map.slice(view_offsets, view_dims);
        return view;
    }

    void update() {
        auto view = get_view();
        class1.get_direction(view, 2, 2);
    }
};

int main() {}

Steps to reproduce

Compile with gcc

What is the current bug behavior?

Warning: cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:166:56: attention: comparaison entre « enum Eigen::internal::array_size<const std::array<long int, 3>, void>::<unnamed> » et « enum Eigen::internal::array_size<std::array<long int, 1>, void>::<unnamed> »

What is the expected correct behavior?

Should compile

Warning Messages

➜ g++ main2.cpp -I cmake-build-debug/_deps/eigen-src -std=c++20
Dans le fichier inclus depuis cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/Tensor:94,
                 depuis main2.cpp:1:
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h: Dans l'instanciation de « Index Eigen::internal::SimpleTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, Alignment, MakePointer_>::computeIndex(Index, Index) const [with Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = true; int Alignment = 0; MakePointer_ = Eigen::MakePointer] » :
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:262:45:   requis par « std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> Eigen::internal::BaseTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, inner_dim_reordered, Alignment, MakePointer_>::load(Index, Index) const [with PacketT = __vector(4) float; int AlignmentType = 0; Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = true; bool inner_dim_reordered = false; int Alignment = 0; MakePointer_ = Eigen::MakePointer; std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> = std::enable_if<true, __vector(4) float>::type] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/../../../Eigen/src/Core/products/GeneralMatrixVector.h:160:66:   requis par « static void Eigen::internal::general_matrix_vector_product<Index, LhsScalar, LhsMapper, 0, ConjugateLhs, RhsScalar, RhsMapper, ConjugateRhs, Version>::run(Index, Index, const LhsMapper&, const RhsMapper&, ResScalar*, Index, RhsScalar) [with Index = long int; LhsScalar = float; LhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 1, Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>, std::array<long int, 2>, std::array<long int, 1>, 4, true, false, 0, Eigen::MakePointer>; bool ConjugateLhs = false; RhsScalar = float; RhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 0, Eigen::TensorEvaluator<const Eigen::Tensor<float, 1>, Eigen::DefaultDevice>, std::array<long int, 0>, std::array<long int, 1>, 4, true, true, 16, Eigen::MakePointer>; bool ConjugateRhs = false; int Version = 0; ResScalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:731:56:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalGemv(Scalar*) const [with bool lhs_inner_dim_contiguous = true; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:686:118:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalProductSequential(Scalar*) const [with bool lhs_inner_dim_contiguous = true; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:956:5:   requis par « void Eigen::TensorEvaluator<const Eigen::TensorContractionOp<Dimensions, LhsXprType, RhsXprType, OutputKernelType>, Device_>::evalProduct(Scalar*) const [with int Alignment = 0; Indices = const std::array<Eigen::IndexPair<int>, 1>; LeftArgType = const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >; RightArgType = const Eigen::Tensor<float, 1>; OutputKernelType = const Eigen::NoOpOutputKernel; Device = Eigen::DefaultDevice; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:673:71:   [ passe outre 3 contextes d'instanciation, utilisez -ftemplate-backtrace-limit=0 pour désactiver ]
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h:209:32:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorBroadcastingOp<Broadcast, XprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with Broadcast = const std::array<long int, 3>; ArgType = const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h:140:44:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorAssignOp<LhsXprType, RhsXprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with LeftArgType = Eigen::Tensor<float, 3>; RightArgType = const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h:176:61:   requis par « static void Eigen::internal::TensorExecutor<Expression, Eigen::DefaultDevice, Vectorizable, Eigen::internal::On>::run(const Expression&, const Eigen::DefaultDevice&) [with Expression = const Eigen::TensorAssignOp<Eigen::Tensor<float, 3>, const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > > >; bool Vectorizable = true] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/Tensor.h:263:63:   requis par « Eigen::Tensor<Scalar_, NumIndices_, Options_, IndexType>::Tensor(const Eigen::TensorBase<OtherDerived, 0>&) [with OtherDerived = Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Scalar_ = float; int NumIndices_ = 3; int Options_ = 0; IndexType_ = long int] »
main2.cpp:14:26:   requis par « void Class1::get_direction(auto:48&, int, int) [with auto:48 = Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >] »
main2.cpp:34:29:   requis depuis ici
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:131:56: attention: comparaison entre « enum Eigen::internal::array_size<const std::array<long int, 3>, void>::<unnamed> » et « enum Eigen::internal::array_size<std::array<long int, 1>, void>::<unnamed> » [-Wenum-compare]
  131 |     if (array_size<typename Tensor::Dimensions>::value > array_size<contract_t>::value) {
      |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h: Dans l'instanciation de « Eigen::IndexPair<Index> Eigen::internal::SimpleTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, Alignment, MakePointer_>::computeIndexPair(Index, Index, Index) const [with Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = true; int Alignment = 0; MakePointer_ = Eigen::MakePointer] » :
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:267:62:   requis par « std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> Eigen::internal::BaseTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, inner_dim_reordered, Alignment, MakePointer_>::load(Index, Index) const [with PacketT = __vector(4) float; int AlignmentType = 0; Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = true; bool inner_dim_reordered = false; int Alignment = 0; MakePointer_ = Eigen::MakePointer; std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> = std::enable_if<true, __vector(4) float>::type] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/../../../Eigen/src/Core/products/GeneralMatrixVector.h:160:66:   requis par « static void Eigen::internal::general_matrix_vector_product<Index, LhsScalar, LhsMapper, 0, ConjugateLhs, RhsScalar, RhsMapper, ConjugateRhs, Version>::run(Index, Index, const LhsMapper&, const RhsMapper&, ResScalar*, Index, RhsScalar) [with Index = long int; LhsScalar = float; LhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 1, Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>, std::array<long int, 2>, std::array<long int, 1>, 4, true, false, 0, Eigen::MakePointer>; bool ConjugateLhs = false; RhsScalar = float; RhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 0, Eigen::TensorEvaluator<const Eigen::Tensor<float, 1>, Eigen::DefaultDevice>, std::array<long int, 0>, std::array<long int, 1>, 4, true, true, 16, Eigen::MakePointer>; bool ConjugateRhs = false; int Version = 0; ResScalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:731:56:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalGemv(Scalar*) const [with bool lhs_inner_dim_contiguous = true; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:686:118:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalProductSequential(Scalar*) const [with bool lhs_inner_dim_contiguous = true; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:956:5:   requis par « void Eigen::TensorEvaluator<const Eigen::TensorContractionOp<Dimensions, LhsXprType, RhsXprType, OutputKernelType>, Device_>::evalProduct(Scalar*) const [with int Alignment = 0; Indices = const std::array<Eigen::IndexPair<int>, 1>; LeftArgType = const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >; RightArgType = const Eigen::Tensor<float, 1>; OutputKernelType = const Eigen::NoOpOutputKernel; Device = Eigen::DefaultDevice; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:673:71:   [ passe outre 3 contextes d'instanciation, utilisez -ftemplate-backtrace-limit=0 pour désactiver ]
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h:209:32:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorBroadcastingOp<Broadcast, XprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with Broadcast = const std::array<long int, 3>; ArgType = const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h:140:44:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorAssignOp<LhsXprType, RhsXprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with LeftArgType = Eigen::Tensor<float, 3>; RightArgType = const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h:176:61:   requis par « static void Eigen::internal::TensorExecutor<Expression, Eigen::DefaultDevice, Vectorizable, Eigen::internal::On>::run(const Expression&, const Eigen::DefaultDevice&) [with Expression = const Eigen::TensorAssignOp<Eigen::Tensor<float, 3>, const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > > >; bool Vectorizable = true] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/Tensor.h:263:63:   requis par « Eigen::Tensor<Scalar_, NumIndices_, Options_, IndexType>::Tensor(const Eigen::TensorBase<OtherDerived, 0>&) [with OtherDerived = Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Scalar_ = float; int NumIndices_ = 3; int Options_ = 0; IndexType_ = long int] »
main2.cpp:14:26:   requis par « void Class1::get_direction(auto:48&, int, int) [with auto:48 = Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >] »
main2.cpp:34:29:   requis depuis ici
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:166:56: attention: comparaison entre « enum Eigen::internal::array_size<const std::array<long int, 3>, void>::<unnamed> » et « enum Eigen::internal::array_size<std::array<long int, 1>, void>::<unnamed> » [-Wenum-compare]
  166 |     if (array_size<typename Tensor::Dimensions>::value > array_size<contract_t>::value) {
      |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h: Dans l'instanciation de « Index Eigen::internal::SimpleTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, Alignment, MakePointer_>::computeIndex(Index, Index) const [with Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = false; int Alignment = 0; MakePointer_ = Eigen::MakePointer] » :
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:262:45:   requis par « std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> Eigen::internal::BaseTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, inner_dim_reordered, Alignment, MakePointer_>::load(Index, Index) const [with PacketT = __vector(4) float; int AlignmentType = 0; Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = false; bool inner_dim_reordered = false; int Alignment = 0; MakePointer_ = Eigen::MakePointer; std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> = std::enable_if<true, __vector(4) float>::type] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/../../../Eigen/src/Core/products/GeneralMatrixVector.h:160:66:   requis par « static void Eigen::internal::general_matrix_vector_product<Index, LhsScalar, LhsMapper, 0, ConjugateLhs, RhsScalar, RhsMapper, ConjugateRhs, Version>::run(Index, Index, const LhsMapper&, const RhsMapper&, ResScalar*, Index, RhsScalar) [with Index = long int; LhsScalar = float; LhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 1, Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>, std::array<long int, 2>, std::array<long int, 1>, 4, false, false, 0, Eigen::MakePointer>; bool ConjugateLhs = false; RhsScalar = float; RhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 0, Eigen::TensorEvaluator<const Eigen::Tensor<float, 1>, Eigen::DefaultDevice>, std::array<long int, 0>, std::array<long int, 1>, 4, true, true, 16, Eigen::MakePointer>; bool ConjugateRhs = false; int Version = 0; ResScalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:731:56:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalGemv(Scalar*) const [with bool lhs_inner_dim_contiguous = false; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:686:118:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalProductSequential(Scalar*) const [with bool lhs_inner_dim_contiguous = false; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:956:5:   requis par « void Eigen::TensorEvaluator<const Eigen::TensorContractionOp<Dimensions, LhsXprType, RhsXprType, OutputKernelType>, Device_>::evalProduct(Scalar*) const [with int Alignment = 0; Indices = const std::array<Eigen::IndexPair<int>, 1>; LeftArgType = const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >; RightArgType = const Eigen::Tensor<float, 1>; OutputKernelType = const Eigen::NoOpOutputKernel; Device = Eigen::DefaultDevice; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:673:71:   [ passe outre 3 contextes d'instanciation, utilisez -ftemplate-backtrace-limit=0 pour désactiver ]
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h:209:32:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorBroadcastingOp<Broadcast, XprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with Broadcast = const std::array<long int, 3>; ArgType = const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h:140:44:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorAssignOp<LhsXprType, RhsXprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with LeftArgType = Eigen::Tensor<float, 3>; RightArgType = const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h:176:61:   requis par « static void Eigen::internal::TensorExecutor<Expression, Eigen::DefaultDevice, Vectorizable, Eigen::internal::On>::run(const Expression&, const Eigen::DefaultDevice&) [with Expression = const Eigen::TensorAssignOp<Eigen::Tensor<float, 3>, const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > > >; bool Vectorizable = true] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/Tensor.h:263:63:   requis par « Eigen::Tensor<Scalar_, NumIndices_, Options_, IndexType>::Tensor(const Eigen::TensorBase<OtherDerived, 0>&) [with OtherDerived = Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Scalar_ = float; int NumIndices_ = 3; int Options_ = 0; IndexType_ = long int] »
main2.cpp:14:26:   requis par « void Class1::get_direction(auto:48&, int, int) [with auto:48 = Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >] »
main2.cpp:34:29:   requis depuis ici
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:131:56: attention: comparaison entre « enum Eigen::internal::array_size<const std::array<long int, 3>, void>::<unnamed> » et « enum Eigen::internal::array_size<std::array<long int, 1>, void>::<unnamed> » [-Wenum-compare]
  131 |     if (array_size<typename Tensor::Dimensions>::value > array_size<contract_t>::value) {
      |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h: Dans l'instanciation de « Eigen::IndexPair<Index> Eigen::internal::SimpleTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, Alignment, MakePointer_>::computeIndexPair(Index, Index, Index) const [with Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = false; int Alignment = 0; MakePointer_ = Eigen::MakePointer] » :
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:267:62:   requis par « std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> Eigen::internal::BaseTensorContractionMapper<Scalar, Index, side, Tensor, nocontract_t, contract_t, packet_size, inner_dim_contiguous, inner_dim_reordered, Alignment, MakePointer_>::load(Index, Index) const [with PacketT = __vector(4) float; int AlignmentType = 0; Scalar = float; Index = long int; int side = 1; Tensor = Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>; nocontract_t = std::array<long int, 2>; contract_t = std::array<long int, 1>; int packet_size = 4; bool inner_dim_contiguous = false; bool inner_dim_reordered = false; int Alignment = 0; MakePointer_ = Eigen::MakePointer; std::enable_if_t<(Eigen::internal::unpacket_traits<Packet>::size == packet_size), PacketT> = std::enable_if<true, __vector(4) float>::type] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/../../../Eigen/src/Core/products/GeneralMatrixVector.h:160:66:   requis par « static void Eigen::internal::general_matrix_vector_product<Index, LhsScalar, LhsMapper, 0, ConjugateLhs, RhsScalar, RhsMapper, ConjugateRhs, Version>::run(Index, Index, const LhsMapper&, const RhsMapper&, ResScalar*, Index, RhsScalar) [with Index = long int; LhsScalar = float; LhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 1, Eigen::TensorEvaluator<const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, Eigen::DefaultDevice>, std::array<long int, 2>, std::array<long int, 1>, 4, false, false, 0, Eigen::MakePointer>; bool ConjugateLhs = false; RhsScalar = float; RhsMapper = Eigen::internal::TensorContractionInputMapper<float, long int, 0, Eigen::TensorEvaluator<const Eigen::Tensor<float, 1>, Eigen::DefaultDevice>, std::array<long int, 0>, std::array<long int, 1>, 4, true, true, 16, Eigen::MakePointer>; bool ConjugateRhs = false; int Version = 0; ResScalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:731:56:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalGemv(Scalar*) const [with bool lhs_inner_dim_contiguous = false; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:686:118:   requis par « void Eigen::TensorContractionEvaluatorBase<Derived>::evalProductSequential(Scalar*) const [with bool lhs_inner_dim_contiguous = false; bool rhs_inner_dim_contiguous = true; bool rhs_inner_dim_reordered = true; int Alignment = 0; Derived = Eigen::TensorEvaluator<const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel>, Eigen::DefaultDevice>; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:956:5:   requis par « void Eigen::TensorEvaluator<const Eigen::TensorContractionOp<Dimensions, LhsXprType, RhsXprType, OutputKernelType>, Device_>::evalProduct(Scalar*) const [with int Alignment = 0; Indices = const std::array<Eigen::IndexPair<int>, 1>; LeftArgType = const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >; RightArgType = const Eigen::Tensor<float, 1>; OutputKernelType = const Eigen::NoOpOutputKernel; Device = Eigen::DefaultDevice; Scalar = float] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h:673:71:   [ passe outre 3 contextes d'instanciation, utilisez -ftemplate-backtrace-limit=0 pour désactiver ]
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h:209:32:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorBroadcastingOp<Broadcast, XprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with Broadcast = const std::array<long int, 3>; ArgType = const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h:140:44:   requis par « bool Eigen::TensorEvaluator<const Eigen::TensorAssignOp<LhsXprType, RhsXprType>, Device>::evalSubExprsIfNeeded(EvaluatorPointerType) [with LeftArgType = Eigen::Tensor<float, 3>; RightArgType = const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Device = Eigen::DefaultDevice; EvaluatorPointerType = float*] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h:176:61:   requis par « static void Eigen::internal::TensorExecutor<Expression, Eigen::DefaultDevice, Vectorizable, Eigen::internal::On>::run(const Expression&, const Eigen::DefaultDevice&) [with Expression = const Eigen::TensorAssignOp<Eigen::Tensor<float, 3>, const Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > > >; bool Vectorizable = true] »
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/Tensor.h:263:63:   requis par « Eigen::Tensor<Scalar_, NumIndices_, Options_, IndexType>::Tensor(const Eigen::TensorBase<OtherDerived, 0>&) [with OtherDerived = Eigen::TensorBroadcastingOp<const std::array<long int, 3>, const Eigen::TensorReshapingOp<const std::array<long int, 3>, const Eigen::TensorContractionOp<const std::array<Eigen::IndexPair<int>, 1>, const Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >, const Eigen::Tensor<float, 1>, const Eigen::NoOpOutputKernel> > >; Scalar_ = float; int NumIndices_ = 3; int Options_ = 0; IndexType_ = long int] »
main2.cpp:14:26:   requis par « void Class1::get_direction(auto:48&, int, int) [with auto:48 = Eigen::TensorSlicingOp<const std::array<long int, 3>, const std::array<long int, 3>, Eigen::Tensor<float, 3> >] »
main2.cpp:34:29:   requis depuis ici
cmake-build-debug/_deps/eigen-src/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h:166:56: attention: comparaison entre « enum Eigen::internal::array_size<const std::array<long int, 3>, void>::<unnamed> » et « enum Eigen::internal::array_size<std::array<long int, 1>, void>::<unnamed> » [-Wenum-compare]
  166 |     if (array_size<typename Tensor::Dimensions>::value > array_size<contract_t>::value) {
      |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Anything else that might help

It compiles on godbolt but not on local install (reproduced by someone else).

  • Have a plan to fix this issue.
Edited by Clement Dumas