[eigen] some problems with building with AltiVec enabled |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] some problems with building with AltiVec enabled
- From: Konstantinos Margaritis <markos@xxxxxxxx>
- Date: Wed, 20 Aug 2008 16:31:28 +0300
- Organization: CODEX
Hi all,
I'd like to bring the AltiVec support back to life :) and I did some tests.
For some reason, template specialization doesn't seem to work for
AltiVec and the following errors occur (while compiling adjoint.cpp):
Any help appreciated. I also attach my current AltiVec/PacketMath.h
(note that it will not compile cleanly due to ei_palign() not properly
implemented, apparently offset is a runtime value and vec_sld() needs
values known at compile time, anyway, this is irrelevant for the problem,
I hed the same problems even before).
Konstantinos
---------------------------------------
> make
[ 4%] Building CXX object test/CMakeFiles/test_adjoint.dir/adjoint.o
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘typename Eigen::ei_packet_traits<T>::type Eigen::ei_pload(const
Scalar*) [with Scalar = int]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:109: instantiated from ‘typename Eigen::ei_packet_traits<T>::type
Eigen::ei_ploadt(const Scalar*) [with Scalar = int, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:164: instantiated from ‘typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows,
_Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::packet(int) const [with int
LoadMode = 0, _Scalar = int, int _Rows = 10000, int _Cols = 1, int _MaxRows = 10000, int _MaxCols = 1, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:190: instantiated from ‘static typename Derived1::Scalar Eigen::ei_dot_impl<Derived1,
Derived2, 1, 2>::run(const Derived1&, const Derived2&) [with Derived1 = const Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<int>,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000, 1, 10000, 1, 120u> >,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000, 1, 10000, 1, 120u> > >, Derived2 = const Eigen::Matrix<int, 10000,
1, 10000, 1, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:261: instantiated from ‘typename Eigen::ei_traits<T>::Scalar
Eigen::MatrixBase<Derived>::dot(const Eigen::MatrixBase<OtherDerived>&) const [with OtherDerived = Eigen::Matrix<int, 10000, 1, 10000, 1, 120u>,
Derived = Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<int>, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000,
1, 10000, 1, 120u> >, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000, 1, 10000, 1, 120u> > >]’
/home/markos/Development/eigen2/test/adjoint.cpp:64: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::MatrixXi]’
/home/markos/Development/eigen2/test/adjoint.cpp:97: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:64: σφάλμα: cannot convert ‘const int’ to ‘int __vector__’ in return
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘typename Eigen::ei_packet_traits<T>::type
Eigen::ei_ploadu(const Scalar*) [with Scalar = int]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:111: instantiated from ‘typename Eigen::ei_packet_traits<T>::type
Eigen::ei_ploadt(const Scalar*) [with Scalar = int, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:164: instantiated from ‘typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows,
_Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::packet(int) const [with int
LoadMode = 0, _Scalar = int, int _Rows = 10000, int _Cols = 1, int _MaxRows = 10000, int _MaxCols = 1, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:190: instantiated from ‘static typename Derived1::Scalar Eigen::ei_dot_impl<Derived1,
Derived2, 1, 2>::run(const Derived1&, const Derived2&) [with Derived1 = const Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<int>,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000, 1, 10000, 1, 120u> >,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000, 1, 10000, 1, 120u> > >, Derived2 = const Eigen::Matrix<int, 10000,
1, 10000, 1, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:261: instantiated from ‘typename Eigen::ei_traits<T>::Scalar
Eigen::MatrixBase<Derived>::dot(const Eigen::MatrixBase<OtherDerived>&) const [with OtherDerived = Eigen::Matrix<int, 10000, 1, 10000, 1, 120u>,
Derived = Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<int>, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000,
1, 10000, 1, 120u> >, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<int>, Eigen::Matrix<int, 10000, 1, 10000, 1, 120u> > >]’
/home/markos/Development/eigen2/test/adjoint.cpp:64: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::MatrixXi]’
/home/markos/Development/eigen2/test/adjoint.cpp:97: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:68: σφάλμα: cannot convert ‘const int’ to ‘int __vector__’ in return
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘typename Eigen::ei_packet_traits<T>::type Eigen::ei_pload(const
Scalar*) [with Scalar = float]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:109: instantiated from ‘typename Eigen::ei_packet_traits<T>::type
Eigen::ei_ploadt(const Scalar*) [with Scalar = float, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:164: instantiated from ‘typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows,
_Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::packet(int) const [with int
LoadMode = 0, _Scalar = float, int _Rows = 100, int _Cols = 1, int _MaxRows = 100, int _MaxCols = 1, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:190: instantiated from ‘static typename Derived1::Scalar Eigen::ei_dot_impl<Derived1,
Derived2, 1, 2>::run(const Derived1&, const Derived2&) [with Derived1 = const Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<float>,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float, 100, 1, 100, 1, 120u> >,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float, 100, 1, 100, 1, 120u> > >, Derived2 = const Eigen::Matrix<float, 100, 1,
100, 1, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:261: instantiated from ‘typename Eigen::ei_traits<T>::Scalar
Eigen::MatrixBase<Derived>::dot(const Eigen::MatrixBase<OtherDerived>&) const [with OtherDerived = Eigen::Matrix<float, 100, 1, 100, 1, 120u>,
Derived = Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<float>, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float,
100, 1, 100, 1, 120u> >, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float, 100, 1, 100, 1, 120u> > >]’
/home/markos/Development/eigen2/test/adjoint.cpp:64: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::Matrix<float, 100,
100, 100, 100, 120u>]’
/home/markos/Development/eigen2/test/adjoint.cpp:101: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:64: σφάλμα: cannot convert ‘const float’ to ‘float __vector__’ in return
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘typename Eigen::ei_packet_traits<T>::type
Eigen::ei_ploadu(const Scalar*) [with Scalar = float]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:111: instantiated from ‘typename Eigen::ei_packet_traits<T>::type
Eigen::ei_ploadt(const Scalar*) [with Scalar = float, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:164: instantiated from ‘typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows,
_Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::packet(int) const [with int
LoadMode = 0, _Scalar = float, int _Rows = 100, int _Cols = 1, int _MaxRows = 100, int _MaxCols = 1, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:190: instantiated from ‘static typename Derived1::Scalar Eigen::ei_dot_impl<Derived1,
Derived2, 1, 2>::run(const Derived1&, const Derived2&) [with Derived1 = const Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<float>,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float, 100, 1, 100, 1, 120u> >,
Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float, 100, 1, 100, 1, 120u> > >, Derived2 = const Eigen::Matrix<float, 100, 1,
100, 1, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Dot.h:261: instantiated from ‘typename Eigen::ei_traits<T>::Scalar
Eigen::MatrixBase<Derived>::dot(const Eigen::MatrixBase<OtherDerived>&) const [with OtherDerived = Eigen::Matrix<float, 100, 1, 100, 1, 120u>,
Derived = Eigen::CwiseBinaryOp<Eigen::ei_scalar_sum_op<float>, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float,
100, 1, 100, 1, 120u> >, Eigen::CwiseUnaryOp<Eigen::ei_scalar_multiple_op<float>, Eigen::Matrix<float, 100, 1, 100, 1, 120u> > >]’
/home/markos/Development/eigen2/test/adjoint.cpp:64: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::Matrix<float, 100,
100, 100, 100, 120u>]’
/home/markos/Development/eigen2/test/adjoint.cpp:101: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:68: σφάλμα: cannot convert ‘const float’ to ‘float __vector__’ in return
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘void Eigen::ei_pstore(Scalar*, const Packet&) [with Scalar = int,
Packet = int __vector__]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:118: instantiated from ‘void Eigen::ei_pstoret(Scalar*, const Packet&) [with
Scalar = int, Packet = int __vector__, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:179: instantiated from ‘void Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::writePacket(int, const typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar&)
[with int StoreMode = 0, _Scalar = int, int _Rows = 10000, int _Cols = 10000, int _MaxRows = 10000, int _MaxCols = 10000, unsigned int _Flags =
120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Coeffs.h:315: instantiated from ‘void Eigen::MatrixBase<Derived>::copyPacket(int, const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>, int StoreMode = 0, int LoadMode = 0,
Derived = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:318: instantiated from ‘static void Eigen::ei_assign_impl<Derived1, Derived2, 1,
2>::run(Derived1&, const Derived2&) [with Derived1 = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>, Derived2 = Eigen::Matrix<int, 10000,
10000, 10000, 10000, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:404: instantiated from ‘Derived& Eigen::MatrixBase<Derived>::lazyAssign(const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>, Derived = Eigen::Matrix<int, 10000,
10000, 10000, 10000, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:343: instantiated from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::Matrix(const Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>&) [with _Scalar = int, int _Rows = 10000, int _Cols = 10000,
int _MaxRows = 10000, int _MaxCols = 10000, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/test/adjoint.cpp:38: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::MatrixXi]’
/home/markos/Development/eigen2/test/adjoint.cpp:97: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:76: σφάλμα: cannot convert ‘const int __vector__’ to ‘int’ in assignment
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘void Eigen::ei_pstoreu(Scalar*, const Packet&) [with Scalar = int,
Packet = int __vector__]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:120: instantiated from ‘void Eigen::ei_pstoret(Scalar*, const Packet&) [with
Scalar = int, Packet = int __vector__, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:179: instantiated from ‘void Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::writePacket(int, const typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar&)
[with int StoreMode = 0, _Scalar = int, int _Rows = 10000, int _Cols = 10000, int _MaxRows = 10000, int _MaxCols = 10000, unsigned int _Flags =
120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Coeffs.h:315: instantiated from ‘void Eigen::MatrixBase<Derived>::copyPacket(int, const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>, int StoreMode = 0, int LoadMode = 0,
Derived = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:318: instantiated from ‘static void Eigen::ei_assign_impl<Derived1, Derived2, 1,
2>::run(Derived1&, const Derived2&) [with Derived1 = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>, Derived2 = Eigen::Matrix<int, 10000,
10000, 10000, 10000, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:404: instantiated from ‘Derived& Eigen::MatrixBase<Derived>::lazyAssign(const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<int, 10000, 10000, 10000, 10000, 120u>, Derived = Eigen::Matrix<int, 10000,
10000, 10000, 10000, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:343: instantiated from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::Matrix(const Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>&) [with _Scalar = int, int _Rows = 10000, int _Cols = 10000,
int _MaxRows = 10000, int _MaxCols = 10000, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/test/adjoint.cpp:38: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::MatrixXi]’
/home/markos/Development/eigen2/test/adjoint.cpp:97: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:80: σφάλμα: cannot convert ‘const int __vector__’ to ‘int’ in assignment
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘void Eigen::ei_pstore(Scalar*, const Packet&) [with Scalar = float,
Packet = float __vector__]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:118: instantiated from ‘void Eigen::ei_pstoret(Scalar*, const Packet&) [with
Scalar = float, Packet = float __vector__, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:179: instantiated from ‘void Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::writePacket(int, const typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar&)
[with intStoreMode = 0, _Scalar = float, int _Rows = 100, int _Cols = 100, int _MaxRows = 100, int _MaxCols = 100, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Coeffs.h:315: instantiated from ‘void Eigen::MatrixBase<Derived>::copyPacket(int, const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 100, 100,
100, 100, 120u> >, int StoreMode = 0, int LoadMode = 1, Derived = Eigen::Matrix<float, 100, 100, 100, 100, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:318: instantiated from ‘static void Eigen::ei_assign_impl<Derived1, Derived2, 1,
2>::run(Derived1&, const Derived2&) [with Derived1 = Eigen::Matrix<float, 100, 100, 100, 100, 120u>, Derived2 =
Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 100, 100, 100, 100, 120u> >]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:404: instantiated from ‘Derived& Eigen::MatrixBase<Derived>::lazyAssign(const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 100, 100,
100, 100, 120u> >, Derived = Eigen::Matrix<float, 100, 100, 100, 100, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:337: instantiated from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::Matrix(const Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>,
Eigen::Matrix<float,100, 100, 100, 100, 120u> >, _Scalar = float, int _Rows = 100, int _Cols = 100, int _MaxRows = 100, int _MaxCols = 100, unsigned
int _Flags = 120u]’
/home/markos/Development/eigen2/test/adjoint.cpp:41: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::Matrix<float, 100,
100, 100, 100, 120u>]’
/home/markos/Development/eigen2/test/adjoint.cpp:101: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:76: σφάλμα: cannot convert ‘const float __vector__’ to ‘float’ in assignment
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h: In function ‘void Eigen::ei_pstoreu(Scalar*, const Packet&) [with Scalar =
float,Packet = float __vector__]’:
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:120: instantiated from ‘void Eigen::ei_pstoret(Scalar*, const Packet&) [with
Scalar = float, Packet = float __vector__, int LoadMode = 0]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:179: instantiated from ‘void Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::writePacket(int, const typename Eigen::MatrixBase<Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> >::PacketScalar&)
[with intStoreMode = 0, _Scalar = float, int _Rows = 100, int _Cols = 100, int _MaxRows = 100, int _MaxCols = 100, unsigned int _Flags = 120u]’
/home/markos/Development/eigen2/Eigen/src/Core/Coeffs.h:315: instantiated from ‘void Eigen::MatrixBase<Derived>::copyPacket(int, const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 100, 100,
100, 100, 120u> >, int StoreMode = 0, int LoadMode = 1, Derived = Eigen::Matrix<float, 100, 100, 100, 100, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:318: instantiated from ‘static void Eigen::ei_assign_impl<Derived1, Derived2, 1,
2>::run(Derived1&, const Derived2&) [with Derived1 = Eigen::Matrix<float, 100, 100, 100, 100, 120u>, Derived2 =
Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 100, 100, 100, 100, 120u> >]’
/home/markos/Development/eigen2/Eigen/src/Core/Assign.h:404: instantiated from ‘Derived& Eigen::MatrixBase<Derived>::lazyAssign(const
Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 100, 100,
100, 100, 120u> >, Derived = Eigen::Matrix<float, 100, 100, 100, 100, 120u>]’
/home/markos/Development/eigen2/Eigen/src/Core/Matrix.h:337: instantiated from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols,
_Flags>::Matrix(const Eigen::MatrixBase<OtherDerived>&) [with OtherDerived = Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>,
Eigen::Matrix<float,100, 100, 100, 100, 120u> >, _Scalar = float, int _Rows = 100, int _Cols = 100, int _MaxRows = 100, int _MaxCols = 100, unsigned
int _Flags = 120u]’
/home/markos/Development/eigen2/test/adjoint.cpp:41: instantiated from ‘void adjoint(const MatrixType&) [with MatrixType = Eigen::Matrix<float, 100,
100, 100, 100, 120u>]’
/home/markos/Development/eigen2/test/adjoint.cpp:101: instantiated from here
/home/markos/Development/eigen2/Eigen/src/Core/DummyPacketMath.h:80: σφάλμα: cannot convert ‘const float __vector__’ to ‘float’ in assignment
make[2]: *** [test/CMakeFiles/test_adjoint.dir/adjoint.o] Error 1
make[1]: *** [test/CMakeFiles/test_adjoint.dir/all] Error 2
make: *** [all] Error 2
---------------------------------------
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra. Eigen itself is part of the KDE project.
//
// Copyright (C) 2008 Konstantinos Margaritis <markos@xxxxxxxx>
// Copyright (C) 2008 Gael Guennebaud <g.gael@xxxxxxx>
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// Alternatively, you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License and a copy of the GNU General Public License along with
// Eigen. If not, see <http://www.gnu.org/licenses/>.
#ifndef EIGEN_PACKET_MATH_ALTIVEC_H
#define EIGEN_PACKET_MATH_ALTIVEC_H
#ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD
#define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 4
#endif
static const vector int v0i = vec_splat_s32(0);
static const vector int v16i_ = vec_splat_s32(-16);
static const vector float v0f = (vector float) v0i;
template<> struct ei_packet_traits<float> { typedef vector float type; enum {size=4}; };
template<> struct ei_packet_traits<int> { typedef vector int type; enum {size=4}; };
template<> struct ei_unpacket_traits<vector float> { typedef float type; enum {size=4}; };
template<> struct ei_unpacket_traits<vector int> { typedef int type; enum {size=4}; };
inline vector float ei_padd(const vector float a, const vector float b) { return vec_add(a,b); }
inline vector int ei_padd(const vector int a, const vector int b) { return vec_add(a,b); }
inline vector float ei_psub(const vector float a, const vector float b) { return vec_sub(a,b); }
inline vector int ei_psub(const vector int a, const vector int b) { return vec_sub(a,b); }
inline vector float ei_pmul(const vector float a, const vector float b) { return vec_madd(a,b, v0f); }
inline vector int ei_pmul(const vector int a, const vector int b)
{
// Taken from http://developer.apple.com/hardwaredrivers/ve/algorithms.html#Multiply32
//Set up constants
vector int bswap, lowProduct, highProduct;
// Do real work
bswap = (vector int)vec_rl( (vector unsigned int)b, (vector unsigned int)v16i_ );
lowProduct = vec_mulo( (vector short)a,(vector short)b );
highProduct = vec_msum((vector short)a,(vector short)bswap, v0i);
highProduct = (vector int) vec_sl( (vector unsigned int)highProduct, (vector unsigned int)v16i_ );
return vec_add( lowProduct, highProduct );
}
inline vector float ei_pdiv(const vector float a, const vector float b) {
// Altivec does not offer a divide instruction, we have to do a reciprocal approximation
vector float y = vec_re(b);
// Set up some constants for inverse reciprocals
vector unsigned int v1_;
vector float v1, v0_;
v1 = (vector float) vec_splat_u32(1);
v1_ = vec_splat_u32(-1);
v0_ = (vector float) vec_sl(v1_, v1_);
// Do a Newton-Raphson iteration to get the needed accuracy
y = vec_madd(vec_nmsub( y, b, v1 ), y, y);
vector float res = vec_madd(a, y, v0_);
return res;
}
inline vector float ei_pmadd(const vector float a, const vector float b, const vector float c) { return vec_madd(a, b, c); }
inline vector float ei_pmin(const vector float a, const vector float b) { return vec_min(a,b); }
inline vector int ei_pmin(const vector int a, const vector int b) { return vec_min(a,b); }
inline vector float ei_pmax(const vector float a, const vector float b) { return vec_max(a,b); }
inline vector int ei_pmax(const vector int a, const vector int b) { return vec_max(a,b); }
inline vector float ei_pload(const float* from) { return vec_ld(0, from); }
inline vector int ei_pload(const int* from) { return vec_ld(0, from); }
inline vector float ei_ploadu(const float* from)
{
// Shamelessly taken from
vector unsigned char MSQ, LSQ;
vector unsigned char mask;
MSQ = vec_ld(0, (unsigned char *)from); // most significant quadword
LSQ = vec_ld(15, (unsigned char *)from); // least significant quadword
mask = vec_lvsl(0, from); // create the permute mask
return (vector float) vec_perm(MSQ, LSQ, mask); // align the data
}
inline vector int ei_ploadu(const int* from)
{
// Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
vector unsigned char MSQ, LSQ;
vector unsigned char mask;
MSQ = vec_ld(0, (unsigned char *)from); // most significant quadword
LSQ = vec_ld(15, (unsigned char *)from); // least significant quadword
mask = vec_lvsl(0, from); // create the permute mask
return (vector int) vec_perm(MSQ, LSQ, mask); // align the data
}
inline vector float ei_pset1(const float& from)
{
// Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
float __attribute__(aligned(16)) af[4];
af[0] = from;
vector float vc = vec_ld(0, af);
vc = vec_splat(vc, 0);
return vc;
}
inline vector int ei_pset1(const int& from)
{
int __attribute__(aligned(16)) ai[4];
ai[0] = from;
vector int vc = vec_ld(0, ai);
vc = vec_splat(vc, 0);
return vc;
}
inline void ei_pstore(float* to, const vector float from) { vec_st(from, 0, to); }
inline void ei_pstore(int* to, const vector int from) { vec_st(from, 0, to); }
inline void ei_pstoreu(float* to, const vector float from)
{
// Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
// Warning: not thread safe!
vector unsigned char MSQ, LSQ, edges;
vector unsigned char edgeAlign, align;
MSQ = vec_ld(0, (unsigned char *)to); // most significant quadword
LSQ = vec_ld(15, (unsigned char *)to); // least significant quadword
edgeAlign = vec_lvsl(0, to); // permute map to extract edges
edges=vec_perm(LSQ,MSQ,edgeAlign); // extract the edges
align = vec_lvsr( 0, to ); // permute map to misalign data
MSQ = vec_perm(edges,(vector unsigned char)from,align); // misalign the data (MSQ)
LSQ = vec_perm((vector unsigned char)from,edges,align); // misalign the data (LSQ)
vec_st( LSQ, 15, (unsigned char *)to ); // Store the LSQ part first
vec_st( MSQ, 0, (unsigned char *)to ); // Store the MSQ part
}
inline void ei_pstoreu(int* to , const vector int from )
{
// Taken from http://developer.apple.com/hardwaredrivers/ve/alignment.html
// Warning: not thread safe!
vector unsigned char MSQ, LSQ, edges;
vector unsigned char edgeAlign, align;
MSQ = vec_ld(0, (unsigned char *)to); // most significant quadword
LSQ = vec_ld(15, (unsigned char *)to); // least significant quadword
edgeAlign = vec_lvsl(0, to); // permute map to extract edges
edges=vec_perm(LSQ,MSQ,edgeAlign); // extract the edges
align = vec_lvsr( 0, to ); // permute map to misalign data
MSQ = vec_perm(edges,(vector unsigned char)from,align); // misalign the data (MSQ)
LSQ = vec_perm((vector unsigned char)from,edges,align); // misalign the data (LSQ)
vec_st( LSQ, 15, (unsigned char *)to ); // Store the LSQ part first
vec_st( MSQ, 0, (unsigned char *)to ); // Store the MSQ part
}
inline float ei_pfirst(const vector float a)
{
float __attribute__(aligned(16)) af[4];
vec_st(a, 0, af);
return af[0];
}
inline int ei_pfirst(const vector int a)
{
int __attribute__(aligned(16)) ai[4];
vec_st(a, 0, ai);
return ai[0];
}
inline vector float ei_preduxp(const vector float* vecs)
{
vector float v[4], sum[4];
// It's easier and faster to transpose then add as columns
// Check: http://www.freevec.org/function/matrix_4x4_transpose_floats for explanation
// Do the transpose, first set of moves
v[0] = vec_mergeh(vecs[0], vecs[2]);
v[1] = vec_mergel(vecs[0], vecs[2]);
v[2] = vec_mergeh(vecs[1], vecs[3]);
v[3] = vec_mergel(vecs[1], vecs[3]);
// Get the resulting vectors
sum[0] = vec_mergeh(v[0], v[2]);
sum[1] = vec_mergel(v[0], v[2]);
sum[2] = vec_mergeh(v[1], v[3]);
sum[3] = vec_mergel(v[1], v[3]);
// Now do the summation:
// Lines 0+1
sum[0] = vec_add(sum[0], sum[1]);
// Lines 2+3
sum[1] = vec_add(sum[2], sum[3]);
// Add the results
sum[0] = vec_add(sum[0], sum[1]);
return sum[0];
}
inline float ei_predux(const vector float& a)
{
vector float b, sum;
b = (vector float)vec_sl((vector unsigned char)a, vec_splat_u8(8));
sum = vec_add(a, b);
b = (vector float)vec_sl((vector unsigned char)a, vec_splat_u8(4));
sum = vec_add(a, b);
return ei_pfirst(sum);
}
inline vector int ei_preduxp(const vector int* vecs)
{
vector int v[4], sum[4];
// It's easier and faster to transpose then add as columns
// Check: http://www.freevec.org/function/matrix_4x4_transpose_floats for explanation
// Do the transpose, first set of moves
v[0] = vec_mergeh(vecs[0], vecs[2]);
v[1] = vec_mergel(vecs[0], vecs[2]);
v[2] = vec_mergeh(vecs[1], vecs[3]);
v[3] = vec_mergel(vecs[1], vecs[3]);
// Get the resulting vectors
sum[0] = vec_mergeh(v[0], v[2]);
sum[1] = vec_mergel(v[0], v[2]);
sum[2] = vec_mergeh(v[1], v[3]);
sum[3] = vec_mergel(v[1], v[3]);
// Now do the summation:
// Lines 0+1
sum[0] = vec_add(sum[0], sum[1]);
// Lines 2+3
sum[1] = vec_add(sum[2], sum[3]);
// Add the results
sum[0] = vec_add(sum[0], sum[1]);
return sum[0];
}
inline int ei_predux(const vector int& a)
{
vector int sum, v0 = vec_splat_s32(0);
sum = vec_sums(a, v0);
sum = vec_sld(sum, v0, 12);
return ei_pfirst(sum);
}
template<int Offset>
struct ei_palign_impl<Offset, vector float>
{
inline static void run(vector float& first, const vector float& second)
{
first = vec_sld(first, second, Offset*4);
}
};
template<int Offset>
struct ei_palign_impl<Offset, vector int>
{
inline static void run(vector int& first, const vector int& second)
{
first = vec_sld(first, second, Offset*4);
}
};
#endif // EIGEN_PACKET_MATH_ALTIVEC_H