Skip to content

Commit

Permalink
[Trifocal+P2Pt] optimized Eigen includes
Browse files Browse the repository at this point in the history
  • Loading branch information
rfabbri committed Nov 3, 2023
1 parent bec3d9d commit 631f2ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions minus/Eigen/LU
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//#include "src/misc/Kernel.h"
//#include "src/misc/Image.h"
//#include "src/LU/FullPivLU.h"
#include "src/LU/PartialPivLU.h"
//#include "src/LU/PartialPivLU.h"
/*
#ifdef EIGEN_USE_LAPACKE
#ifdef EIGEN_USE_MKL
Expand All @@ -38,13 +38,13 @@
#endif
#include "src/LU/Determinant.h"
*/
#include "src/LU/InverseImpl.h"
//#include "src/LU/InverseImpl.h"

// Use the SSE optimized version whenever possible. At the moment the
// SSE version doesn't compile when AVX is enabled
#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
#include "src/LU/arch/Inverse_SSE.h"
#endif
//#if defined EIGEN_VECTORIZE_SSE && !defined EIGEN_VECTORIZE_AVX
// #include "src/LU/arch/Inverse_SSE.h"
//#endif

/*
#include "src/Core/util/ReenableStupidWarnings.h"
Expand Down
2 changes: 2 additions & 0 deletions minus/lsolve.hxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

// Specific to Chicago
template <problem P, typename F>
__attribute__((always_inline)) inline void
Expand Down Expand Up @@ -71,5 +72,6 @@ lsolve(
x(2) -= (m(2,3)*x(3)+m(2,4)*x(4)+m(2,5)*x(5)+m(2,6)*x(6)+m(2,7)*x(7)+m(2,8)*x(8)+m(2,9)*x(9)+m(2,10)*x(10)+m(2,11)*x(11)+m(2,12)*x(12)+m(2,13)*x(13)); x(2) /= m(2,2);
x(1) -= (m(1,2)*x(2)+m(1,3)*x(3)+m(1,4)*x(4)+m(1,5)*x(5)+m(1,6)*x(6)+m(1,7)*x(7)+m(1,8)*x(8)+m(1,9)*x(9)+m(1,10)*x(10)+m(1,11)*x(11)+m(1,12)*x(12)+m(1,13)*x(13)); x(1) /= m(1,1);
x(0) -= (m(0,1)*x(1)+m(0,2)*x(2)+m(0,3)*x(3)+m(0,4)*x(4)+m(0,5)*x(5)+m(0,6)*x(6)+m(0,7)*x(7)+m(0,8)*x(8)+m(0,9)*x(9)+m(0,10)*x(10)+m(0,11)*x(11)+m(0,12)*x(12)+m(0,13)*x(13)); x(0) /= m(0,0);

asm("#------ END Lsolve itself"); // it is not inlining it, and also there is too many vmovsd moving data. It is sub-vectorized, using only xmm no y or zmm
}
3 changes: 1 addition & 2 deletions minus/minus.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "minus.h"
#include "internal-util.hxx"

#include "Eigen/LU"
#include "Eigen/Core"

namespace MiNuS {

Expand Down Expand Up @@ -53,7 +53,6 @@ track(const track_settings &s, const C<F> s_sols[f::nve*f::nsols], const C<F> pa
Map<const Matrix<C<F>, f::nve, 1>, Aligned > bb(RHS);
static constexpr F the_smallest_number = 1e-13; // XXX BENCHMARK THIS
typedef minus_array<f::nve,F> v; typedef minus_array<NVEPLUS1,F> vp;
PartialPivLU<Matrix<C<F>, f::nve, f::nve> > lu;

solution *t_s = raw_solutions + sol_min; // current target solution
const C<F>* __restrict s_s = s_sols + sol_min*f::nve; // current start solution
Expand Down

0 comments on commit 631f2ad

Please sign in to comment.