The reason is that Vc does not yield plain references anymore when accessing entries of simd vectors and masks, but proxy objects. These proxy objects are non-copyable and non-movable. This means that our abstraction for accessing entries of such vectors and masks, the function lane(), cannot return these proxies.
There is an updated simd interface that I (@joe) am working on in !193 (merged). That circumvents this issue by using it's own proxy class.
I currently intend to fix this by replacing the old interface by the one from !193 (merged), eventually.
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
[ 60%] Building CXX object dune/common/test/CMakeFiles/fmatrixtest.dir/fmatrixtest.cc.oIn file included from /home/joe/Projekte/dune-simd/dune-common/dune/common/densematrix.hh:19:0, from /home/joe/Projekte/dune-simd/dune-common/dune/common/fmatrix.hh:15, from /home/joe/Projekte/dune-simd/dune-common/dune/common/test/fmatrixtest.cc:23:/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh: In instantiation of ‘T& Dune::lane(std::size_t, Vc_1::SimdArray<T, N, V, V:: Size>&) [with T = double; long unsigned int n = 8ul; V = Vc_1::Vector<double, Vc_1::VectorAbi::Avx>; std::size_t = long unsigned int]’:/home/joe/Projekte/dune-simd/dune-common/dune/common/densematrix.hh:894:35: required from ‘void Dune::DenseMatrix<M>::luDecomposition(Dune::DenseMatrix<M>&, Func, Mask&, bool) const [with Func = Dune::DenseMatrix<Dune::FieldMatrix<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, 4, 4> >::ElimDet; Mask = Vc_1::SimdMaskArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>; MAT = Dune::FieldMatrix<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, 4, 4>]’/home/joe/Projekte/dune-simd/dune-common/dune/common/densematrix.hh:1112:61: required from ‘Dune::DenseMatrix<M>::field_type Dune::DenseMatrix<M>::determinant() const [with MAT = Dune::FieldMatrix<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, 4, 4>; Dune::DenseMatrix<M>::field_type = Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>]’/home/joe/Projekte/dune-simd/dune-common/dune/common/test/fmatrixtest.cc:370:41: required from ‘int test_determinant() [with T = Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>]’/home/joe/Projekte/dune-simd/dune-common/dune/common/test/fmatrixtest.cc:659:60: required from here/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh:245:15: error: invalid initialization of non-const reference of type ‘double&’ from an rvalue of type ‘Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>::reference {aka Vc_1::Detail::ElementReference<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul> >}’ return v[l]; ^/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh: In instantiation of ‘T& Dune::lane(std::size_t, Vc_1::SimdArray<T, N, V, V:: Size>&) [with T = int; long unsigned int n = 8ul; V = Vc_1::Vector<int, Vc_1::VectorAbi::Avx>; std::size_t = long unsigned int]’:/home/joe/Projekte/dune-simd/dune-common/dune/common/densematrix.hh:894:60: required from ‘void Dune::DenseMatrix<M>::luDecomposition(Dune::DenseMatrix<M>&, Func, Mask&, bool) const [with Func = Dune::DenseMatrix<Dune::FieldMatrix<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, 4, 4> >::ElimDet; Mask = Vc_1::SimdMaskArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>; MAT = Dune::FieldMatrix<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, 4, 4>]’/home/joe/Projekte/dune-simd/dune-common/dune/common/densematrix.hh:1112:61: required from ‘Dune::DenseMatrix<M>::field_type Dune::DenseMatrix<M>::determinant() const [with MAT = Dune::FieldMatrix<Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>, 4, 4>; Dune::DenseMatrix<M>::field_type = Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>]’/home/joe/Projekte/dune-simd/dune-common/dune/common/test/fmatrixtest.cc:370:41: required from ‘int test_determinant() [with T = Vc_1::SimdArray<double, 8ul, Vc_1::Vector<double, Vc_1::VectorAbi::Avx>, 4ul>]’/home/joe/Projekte/dune-simd/dune-common/dune/common/test/fmatrixtest.cc:659:60: required from here/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh:245:15: error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘Vc_1::SimdArray<int, 8ul, Vc_1::Vector<int, Vc_1::VectorAbi::Avx>, 8ul>::reference {aka Vc_1::Detail::ElementReference<Vc_1::SimdArray<int, 8ul, Vc_1::Vector<int, Vc_1::VectorAbi::Avx>, 8ul>, Vc_1::SimdArray<int, 8ul, Vc_1::Vector<int, Vc_1::VectorAbi::Avx>, 8ul> >}’/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh: In function ‘T& Dune::lane(std::size_t, Vc_1::SimdArray<T, N, V, V:: Size>&) [with T = int; long unsigned int n = 8ul; V = Vc_1::Vector<int, Vc_1::VectorAbi::Avx>; std::size_t = long unsigned int]’:/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh:246:3: warning: control reaches end of non-void function [-Wreturn-type] } ^/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh: In function ‘T& Dune::lane(std::size_t, Vc_1::SimdArray<T, N, V, V:: Size>&) [with T = double; long unsigned int n = 8ul; V = Vc_1::Vector<double, Vc_1::VectorAbi::Avx>; std::size_t = long unsigned int]’:/home/joe/Projekte/dune-simd/dune-common/dune/common/simd.hh:246:3: warning: control reaches end of non-void function [-Wreturn-type] } ^dune/common/test/CMakeFiles/fmatrixtest.dir/build.make:54: recipe for target 'dune/common/test/CMakeFiles/fmatrixtest.dir/fmatrixtest.cc.o' failedmake[3]: *** [dune/common/test/CMakeFiles/fmatrixtest.dir/fmatrixtest.cc.o] Error 1
I now consider this a bit more urgent since users of Ubuntu 17.04 may run into this simply by having vc-dev installed. Although, aside from the failing test, it should not affect anyone who is not actually using Vc.
@joe: With the current master 9c6f2e13 I still get an error for fmatrixtest on ubuntu 17.04 with vc-dev installed (see attached error log).build_test_error
OK, that must be because I tested with vc 1.3.2 and ubuntu 17.04 has vc 1.3.0. I suppose the vc proxy gained support for swap() in 1.3.2. I'll have to implement my swap() without using swap myself, then.